Skip to content

A discord bot to quickly summarize conversations you may have missed

kennethprose/skimbot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkimBot

Overview

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.

Bot Setup

  • 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
    • On the Bot tab, copy the bot token.

Enviorment Variables

The following environment variables are required for this bot to function properly:

  • TOKEN: The Discord API token.
  • GUILD_ID: The ID of the
  • URL: 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.

Docker Setup

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 Command

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:latest

Docker Compose File

services:
    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

Native Setup

  1. 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
  2. Download this repo

  3. 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. 
      
  4. Run the bot

    • Once the .env file is configured, run the skimbot.py Python file.
    • In Discord, use the /skim slash command followed by the number of messages you want to summarize (e.g., /skim 20).

About

A discord bot to quickly summarize conversations you may have missed

Topics

Resources

Stars

Watchers

Forks