This is a Discord bot that utilizes a self-hosted version of Ollama AI to respond to user messages. The bot can also provide random quotes from a file.
- Node.js (v14 or higher)
- npm (v6 or higher)
- A Discord bot token
- A self-hosted instance of Ollama AI
-
Clone the repository:
git clone https://github.com/jonschenk/discord-ai.git cd discord-ai -
Install dependencies:
npm install
-
Set up environment variables:
Create a
.envfile in the root directory and add your Discord bot token and command prefix:TOKEN="YOUR_DISCORD_BOT_TOKEN" PREFIX="YOUR_COMMAND_PREFIX" PROMPT="YOUR_SETUP_PROMPT_GOES_HERE"
-
Start your self-hosted Ollama AI instance:
Ensure that your Ollama AI instance is running and accessible at
http://localhost:11434. -
Run the bot:
npm start
You should see a message indicating that the bot is ready:
✅ YourBotName is ready
-
Ask a question:
In any Discord channel where the bot is present, type:
YOUR_COMMAND_PREFIXyour question hereThe bot will generate a response using Ollama AI and reply to your message.
Feel free to submit issues or pull requests if you find any bugs or have suggestions for improvements.
This project is licensed under the ISC License.