Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

5 Commits

Folders and files

Repository files navigation

discord-faqbot

A Discord bot that answers questions based on provided documentation.

Configuration

The bot is configured via environment variables set in the .env file:

  • DISCORD_TOKEN: Your Discord bot token
  • GROQ_API_KEY: Your API key for the Groq API
  • SUPPORT_ROLE_ID (optional): The ID of the role allowed to use the /generate command
  • GUILD_ID (optional): The ID of the server for registering slash commands
  • FAQ_CHANNEL_NAME (optional): The name of the channel where the bot should answer questions (default: faq-fragen)
  • FAQ_CHANNEL_ID (optional): The ID of the channel where the bot should answer questions (takes precedence over FAQ_CHANNEL_NAME)

To enable slash commands, GUILD_ID must be set. Commands will then be registered automatically when the bot starts.

Usage

  1. Create a .env file with your credentials (set GUILD_ID to enable slash commands)
  2. Install dependencies with pip install -r requirements.txt
  3. Start the bot with python main.py

Commands

The bot supports two types of commands:

  1. Traditional prefix commands: !generate <message-id>
  2. Slash commands: /generate <message-id>

Both commands work identically and allow supporters with the configured role to generate a response for any message in any channel.

With slash commands, Discord automatically displays the parameters. Just type /generate and Discord will prompt you to enter the message ID.

How it works

The bot monitors the configured channel for messages ending with a question mark. When such a message is detected, the bot searches the provided documentation for relevant information and generates a response using the Groq API.

The bot also supports the manual command /generate <message-id> (or !generate <message-id>), which allows supporters with the appropriate role to generate a response for any message in any channel. The message does not need to be in the FAQ channel — the command works server-wide.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages