AIChatDiscordBotWeb is a local AI-powered Discord bot running on ASP.NET Core. It integrates local LLMs (via Ollama), web search, and image generation into a seamless chat experience.
What can this local AI do in Discord?
- ๐ฌ Chat: Natural conversation with context awareness.
- ๐ File Analysis: Upload PDF, TXT, or DOCX files, and the bot will read and answer questions based on them.
- ๐๏ธ Vision: Upload images and ask the bot to describe or analyze them (requires a Vision model).
- ๐ Web Search: The bot can search the internet for the latest news and real-time information (requires Serper web api key).
- ๐จ Image Generation: The bot can generate images locally using ComfyUI (requires installed ComfyUI).
- ๐ฃ๏ธ Speaking: The bot can speak in voice channels (requires installed second Discord bot).
Built with C# ASP.NET Core Web App (MVC) on .NET 9.0.
Nuget Libraries used:
DSharpPlus(4.5.1)DSharpPlus.Interactivity(4.5.1)DSharpPlus.SlashCommands(4.5.1)Microsoft.SemanticKernel(1.66.0)Microsoft.SemanticKernel.Connectors.Ollama(1.66.0-alpha)Microsoft.KernelMemory.Core(0.98.250508.3)Microsoft.KernelMemory.AI.Ollama(0.98.250508.3)DocumentFormat.OpenXml(3.3.0)PdfPig(0.1.11)
- Go to the Discord Developer Portal.
- Create a new application and go to the Bot tab.
- Privileged Gateway Intents: Scroll down and enable the intents shown below:

- Installation: Ensure the bot has the following permissions enabled:

- Copy your Bot Token. You will need this for the config.
- Download and install Ollama.
- Open your console/terminal and run:
This must be running in the background for the bot to work.
ollama serve - Note the port number (usually the last 5 digits in the error/status message) to put in your config.

- Download a model (e.g.,
ollama pull PetrosStav/gemma3-tools:4b) via the command line. - Run the list command to get the exact name:
ollama list
- Copy the full model name into your config page.
To enable internet access for the bot:
- Get a free or paid API key from Serper.dev.
- Paste the API Key into the
AIChatDiscordBotWebConfiguration.
To enable image generation:
- Download ComfyUI.
- Recommended Models (Text-to-Image):
NetaYume Lumina Text to Image(Search in ComfyUI templates).- Lumina Image 2.0 Repackaged.
- Place models in:
C:\Users\YourPCName\Documents\ComfyUI\models\checkpoints. - Important: Go to ComfyUI Settings and enable Dev Mode.

- Add your ComfyUI image directory path in the
AIChatDiscordBotWebConfiguration.
To enable voice capabilities (Voice-to-Text and Text-to-Speech), you must run the secondary Python bot alongside this one.
- Repository: RafiBG/AITalkingDiscordBot
- Role: Handles microphone input and generates voice audio using Whisper STT and Piper TTS.
- Setup: Follow the detailed instructions in the link above to install FFmpeg and Piper TTS.
| Command | Description |
|---|---|
/ask [message] (file) (image) |
Main command. Chat with AI. Optionally attach a file (PDF/TXT/DOCX) for context or an image for vision analysis. |
/ask_multi |
Ask three AI models the same question and the main one will summaries the answer. |
/forgetme |
Starts a fresh conversation loop only for you (clears short-term user memory). |
/reset |
Global Reset. Resets all chats and starts a new conversation for everyone. |
/help |
Shows the help menu with these commands. |
Chat & Vision Capabilities
File Analysis & Web Search
Image Generation
Long term memory









