openai/gpt-discord-bot

Example Discord bot written in Python that uses the completions API to have conversations with the `text-davinci-003` model, and the moderations API to...

View on GitHub ↗Jump to charts ↓

Summary Information

Updated 54 minutes ago
Added to GitGenius on April 23rd, 2023
Created on December 21st, 2022
Open Issues & Pull Requests: 13 (+0)
Number of forks: 637
Total Stargazers: 1,825 (+0)
Total Subscribers: 34 (+0)

Repository Insights (GitGenius)

Median issue/PR response: 233.2 days
Mean response time: 227.5 days
90th percentile: 625.4 days
Tracked items: 5

Charts & Analytics

Fetching additional details & charts...

Issue Activity (beta)

Open issues: 8
New in 7 days: 0
Closed in 7 days: 0
Avg open age: 627 days
Stale 30+ days: 8
Stale 90+ days: 8

Recent activity

Opened in 7 days: 0
Closed in 7 days: 0
Comments in 7 days: 0
Events in 7 days: 0

Top labels

  • bug (30)

Most active issues this week

No issue events were indexed in the last 7 days.

Detailed Description

The gpt-discord-bot repository is an example Discord bot implementation written in Python that integrates OpenAI's language models with Discord servers. The bot leverages the chat completions API to enable conversational interactions with the gpt-3.5-turbo model and incorporates the moderations API to filter potentially problematic messages before they are processed or displayed.

The primary feature of this bot is the /chat command, which initiates a public thread within Discord where users can have conversations with the AI model. When a user invokes this command, they provide an initial message along with optional parameters to adjust the temperature and max_tokens settings, allowing fine-tuning of the model's response behavior. The bot automatically generates replies to every user message posted within threads created through the /chat command. A key capability is that the entire conversation thread is passed to the model with each request, enabling the bot to maintain context and remember previous messages within that thread. The bot includes safeguards that automatically close threads when either the context limit is reached or a maximum message count is exceeded.

Customization options are built into the bot's design. Users can modify bot instructions by editing the config.yaml file, and the default model can be changed from gpt-3.5-turbo to other available models. Additional configuration allows for moderation message routing to specific channels per server, with adjustable moderation sensitivity settings in the constants.py file. The bot depends on the OpenAI Python Library and discord.py for its core functionality.

Bug reports represent the most active issue category with seven tracked items.

The repository explicitly states that it is not accepting feature requests, directing users to fork the repository if they wish to implement new features. Only bug fix pull requests are accepted. The maintainers have established dedicated Discord channels for different types of support: a project post channel for bot-specific problems, an API discussions channel for general OpenAI API questions, and the GitHub issues system for template code bugs. Setup requires Python 3.9 or higher and involves configuring environment variables with OpenAI API keys and Discord bot credentials, along with setting appropriate permissions for the bot within Discord servers.