This project is a Discord bot that integrates with an Express server to generate AI-powered responses using Ollama. Users can send messages with a prefix (!) in a Discord server, and the bot will generate a response using the DeepSeek model.
- AI-generated responses using Ollama API
- Express backend for handling AI requests
- Discord bot using
discord.js - Configurable command prefix
Ensure you have the following installed:
- Node.js
- Discord Developer Account
- Ollama installed in your system.
The installation can be divided into two steps, since the project is currently not deployed, users will have to run to run their own backend to run this chatbot.
- Go to the Discord Developer Portal.
- Click New Application → Enter a name → Click Create.

-
Under Bot, scroll down to the Token section.
-
Click Reset Token if needed.
-
Copy and store it in the
.envfile (explained later).
- Navigate to OAuth2 → URL Generator.
- Select bot and applications.commands.
-
Under Bot Permissions, select:
- Send Messages
- Read Message History
- Connect
- Use Slash Commands (optional)
-
Copy the generated URL and open it in your server.
-
Select your server and authorize the bot.
Before running the bot, make sure Ollama is installed and running (if you do not have Ollama installed in your system, check out the Prerequisites section):
ollama servegit clone https://github.com/yourusername/discord-ollama-bot.git
cd discord-ollama-botnpm installCreate a .env file in the root directory and add the following:
DISCORD_TOKEN=your_discord_bot_token
PREFIX=! (this prefix can be the user's choice)
Replace your_discord_bot_token with your actual bot token from the Discord Developer Portal.
Run the following command to start the backend:
node index.jsRun:
npm run bot- Type
!your-messagein a Discord server where the bot is added. - The bot will send an AI-generated response based on the message.
Adding vector db to increase llm memory
[Bot] <-> [Express App] <-> [Vector Search] <-> [Qdrant]
|
[Ollama]
- Deploy the Express backend to services like Vercel, Railway, or a VPS.
- Host the Discord bot on Replit, Railway, or a VPS for 24/7 uptime.
- Add slash commands support.
- Improve response handling and error messages.
- Deploy backend to a cloud-based solution.
/ping- Check bot latency.
This project is open-source under the MIT License.
Feel free to open an issue or reach out!



