Skip to content

A Discord bot in python to use gpt4 with a token instead of a subscription.

License

Notifications You must be signed in to change notification settings

AlexTraveylan/gpt4-discord-bot

Repository files navigation

ChatGPT Discord Bot

Sumary

Overview

The ChatGPT Discord Bot is a versatile chatbot that allows you to have conversations with the GPT-3.5 (or GPT-4 when available) model by OpenAI within Discord threads. It supports a range of features, including predefined personalities (such as JakePy, a Python expert), and the ability to generate images using DALL-E.

Update GPT-4 is available, GPT-4-turbo-preview too

Installation

To run this bot, ensure you have Python 3.11 installed on your system. Follow the steps below to set up a virtual environment (venv) and install the required dependencies:

  1. Clone the bot's GitHub repository using the following command:
    git clone https://github.com/AlexTraveylan/gpt4-discord-bot
  2. Navigate to the project directory:
    cd gpt4-discord-bot
  3. Create a virtual environment using Python 3.11:
    python -m venv venv
  4. Activate the virtual environment:
    • On Linux/macOS:
      source venv/bin/activate
    • On Windows (PowerShell):
      .\venv\Scripts\Activate
  5. Install the required dependencies from the requirements.txt file:
    pip install -r requirements.txt

Configuration

To ensure the bot works correctly, create a .env file at the project's root directory and provide the following information:

PYTHONPATH=.
OPENAI_API_KEY="Your OpenAI token to use the OpenAI API"
DISCORD_BOT_TOKEN="Your Discord bot token"
DISCORD_CLIENT_ID="Your Discord user ID"
ADMIN_SECRET=needed for task, you maybe should delete the feature
MAIN_CHANNEL_ID="Your main channel ID"

Make sure to obtain your OpenAI token by signing up on their website and creating an API key. For the Discord bot token, you'll need to create an application on the Discord Developer Portal and generate a bot token under the "Bot" tab. Your Discord user ID can be obtained by enabling Developer Mode in Discord and copying your own user ID.

Features

Key features of the ChatGPT Discord Bot include:

  • Real-time conversation with the GPT-3.5 (or GPT-4 or GPT-4-turbo-preview) model.
  • Support for predefined personalities with preconfigured prompts, such as JakePy, a Python expert who can assist with pytest.
  • The ability to generate images using DALL-E (upcoming feature).

Feel free to contribute to the bot's development or open issues to report bugs or suggest improvements.

Enjoy engaging in conversations with the ChatGPT Discord Bot! 🤖✨

License

This project is licensed under the MIT License.

Contributing

Contributions are welcome! Please add a pull request for help.

Discord GitHub contributors

About

A Discord bot in python to use gpt4 with a token instead of a subscription.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published