Skip to content

GiridharRNair/ChatGPT-Discord-Bot

Repository files navigation

ChatGPT-Discord-Bot

This Python Discord bot uses the ChatGPT 3.5 Turbo API to generate text and images based on user input.

Prerequisites

You need to have your Discord bot set up on the Discord Developer Portal with all intents and necessary permissions enabled, and your OpenAI API key ready.

You can create and configure a Discord bot at https://discord.com/developers/applications, and you can find your personal OpenAI API key at https://platform.openai.com/account/api-keys.

Permissions for the Discord bot:
Everything under "Text Permissions"

Scopes for the Discord bot:
Just "bot."

Make sure to enable all intents for the Discord bot.

Installation

  1. Clone this repository:
    git clone https://github.com/SyntaxWarrior30/Python-Discord-Bot.git
  2. Enter the Discord bot's current working directory:
    cd ChatGPT-Discord-Bot
  3. Install the required dependencies:
    pip install -r requirements.txt
  4. Input your Discord bot token and ChatGPT API key in the .env file:
    token={Your Discord bot token}
    api_key={Your ChatGPT API key}
  5. Run the bot:
    python main.py

Usage

This bot's prefix for text is "!" and its prefix for images is "/". Prefix for text is unnecessary in DM channels.
Use the following commands to interact with the bot:

!chat [prompt] - Generates a response to the given prompt using ChatGPT 3.5 Turbo API.

/image [prompt] - Generates and sends an image based on the given prompt using ChatGPT 3.5 Turbo API.

Screenshot 2023-03-29 at 8 12 26 PM

Screenshot 2023-03-30 at 11 26 17 AM

About

AI chat bot with natural language processing and image production capabilities using ChatGPT 3.5 Turbo API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages