This bot, named SkimBot, uses Ollama to summarize recent messages in a Discord channel. It fetches a specified number of messages and sends back a summarized version of the conversation.
- Go to the Discord Developer Portal.
- Click new application and customize the bot with a name and profile picture.
- On the OAuth2 tab, use the OAuth2 URL Generator to generate a server invite link with the following permissions and add the bot to your server:
- Scopes
- bot
- applications.commands
- Bot Permissions
- Send messages
- Read message history
- Scopes
- On the Bot tab, copy the bot token.
The following environment variables are required for this bot to function properly:
TOKEN: The Discord API token.GUILD_ID: The ID of theURL: The URL of the Ollama instance.MODEL: The model to use for summarization.PROMPT: The prompt to tell the LLM how you want the conversation to be summarized.
* You can find the Guild ID by logging into discord on the web, opening the desired server, and copying the last number in the URL.
A dockerized version of this app is available on Docker Hub.
All you need to do for the dockerized version is provide your enviornment variables when running the docker container.
docker run -d \
--env TOKEN=your_token \
--env GUILD_ID=your-guild-id \
--env URL=http://your-ai-api-endpoint \
--env MODEL=your-model \
--env PROMPT="Please summarize the following conversation. Please keep it as short as possible without missing any key arguments or details." \
roseatoni/skimbot:latestservices:
skimbot:
environment:
- TOKEN=your-token
- GUILD_ID=your-guild-id
- URL=http://your-ai-api-endpoint
- MODEL=your-model
- PROMPT="Please summarize the following conversation. Please keep it as short as possible without missing any key arguments or details."
image: roseatoni/skimbot:latest-
Install Requirements
- Python 3.x
- discord.py library
- requests library
- python-dotenv library
You can install these libraries using pip:
pip install discord.py requests python-dotenv
-
Download this repo
-
Set Up Environment Variables
-
Create a file called
.env. -
Fill in the enviorment variables:
TOKEN=your-discord-bot-token GUILD_ID=your-guild-id URL=http://localhost:11434/api/generate # Replace with your Ollama endpoint MODEL=gemma3:12b # Replace with your chosen model PROMPT=Please summarize the following conversation. Please keep it as short as possible without missing any key arguments or details.
-
-
Run the bot
- Once the
.envfile is configured, run theskimbot.pyPython file. - In Discord, use the
/skimslash command followed by the number of messages you want to summarize (e.g.,/skim 20).
- Once the