Repository is now in maintanance mode - rewriting project to Typescript on typescript branch
Discord bot to interact with Ollama and AUTOMATIC1111 Stable Diffusion as a chatbot
The project started thanks to mekb.
- Install Node.js (if you have a package manager, use that instead to install this)
- Make sure to install at least v14 of Node.js
 
- Install Ollama (ditto)
- Pull (download) a model, e.g ollama pull orcaorollama pull llama2
- Start Ollama by running ollama serve
- Create a Discord bot
- Under Application » Bot
- Enable Message Content Intent
- Enable Server Members Intent (for replacing user mentions with the username)
 
 
- Under Application » Bot
- Invite the bot to a server
- Go to Application » OAuth2 » URL Generator
- Enable bot
- Enable Send Messages, Read Messages/View Channels, and Read Message History
- Under Generated URL, click Copy and paste the URL in your browser
 
- Rename .env.exampleto.envand edit the.envfile- You can get the token from Application » Bot » Token, never share this with anyone
- Make sure to change the model if you aren't using orca
- Ollama URL can be kept the same unless you have changed the port
- You can use multiple Ollama servers at the same time by separating the URLs with commas
- Set the channels to the channel ID, comma separated
- In Discord, go to User Settings » Advanced, and enable Developer Mode
- Right click on a channel you want to use, and click Copy Channel ID
 
- You can edit the system message the bot uses, or disable it entirely
 
- Install the required dependencies with npm i
- Start the bot with npm start
- You can interact with the bot by @mentioning it with your message
- Install Stable Diffusion
- Run the script ./webui.sh --api --listen
- Install Docker
- Should be atleast compatible with version 3 of compose (docker engine 1.13.0+)
 
- Repeat steps 2—7 from the other setup instructions
- Start the bot with make compose-upif you have Make installed- Otherwise, try docker compose -p discord-ai upinstead
 
- Otherwise, try 
- You can interact with the bot by @mentioning it with your message
