ChatGPT is everywhere. It can be integrated into WhatsApp and let it reply to messages on your behalf; or you can chat with it from WhatsApp and even generate images. Or if you a more of a Telegram person, then you can integrate ChatGPT with Telegram by turning it into a bot.
But apparently, ChatGPT is not in your Discord—at least not yet. But in a few moments, you’ll be able to integrate ChatGPT with Discord and add ChatGPT to Discord and have it in your Discord, too.
The way to integrate ChatGPT into Discord is to create a ChatGPT Discord bot and add it to your server. The bot will respond to you command and return with answers.
After you’ve integrated ChatGPT into Discord, you can use ChatGPT in Discord. No need to switch between apps or tabs; you can have it all within Discord.
You can even generate AI images with the ChatGPT Discord bot. And not just that, there are different personas pre-built into it so that you can easily get the most rogue and unfiltered version of ChatGPT, should you want it.
But, we’re getting ahead of ourselves. Before you integrate ChatGPT with Discord and add a ChatGPT bot in Discord, there are a few things you’ll need.
Prerequisites to integrate ChatGPT with Discord
Before you can create a Chatgpt Discord bot, and integrate ChatGPT with Discord, you’ll need the following.
- Python (3.10 or later)
- OpenAI API key
- Discord bot token
If you don’t have Python installed on your computer, download the latest version from here and install it.
If you are using Linux, you can install directly using this command:
sudo apt install python3
After you’ve installed it, check the version by running the following command
Getting OpenAI API key
An OpenAI API key is not in fact a prerequisite, but using it to authenticate will ensure that the ChatGPT Discord bot works flawlessly.
If you don’t have the secret key saved or don’t have it yet, you can create a new one by clicking the “+ Create new secret key” button. Keep the key safe and confidential; the key will not be displayed again.
Note that the API is not free. So unless you have some free credits, you need to upgrade to a paid plan by setting up a payment method.
Creating a Discord bot
Go to https://discord.com/developers/applications and click “New Application”.
Give the application a name, check the terms of service, then click “Create”.
Click “Bot” on the left panel. Then click the “Add Bot” button.
Name your bot and then click the “View Token” button to uncover your Discord bot token. Or simply click the “Copy” button to copy it. Keep this token somewhere safe. It will be used later on to add ChatGPT to Discord.
Click “OAuth2” on the left panel and select “URL Generator”. Then select the scopes. Make sure to select the “bot” option.
Give the necessary permissions to the bot. A unique URL will be generated for the selected permissions. Copy the URL.
Open a new tab and paste the URL. Select the Discord server to which you want to add the ChatGPT bot. Then click “Continue”.
If you are not the owner of any server, then create one. And then add the ChatGPT bot to your Discord server.
Integrating ChatGPT into Discord will now be a piece of cake. Follow the instructions below to integrate ChatGPT into your Discord server.
How to integrate ChatGPT with Discord
We can now begin to integrate ChatGPT into Discord. Below is a step-by-step guide on how to integrate ChatGPT with Discord.
1. Clone this repository on GitHub. Click the “Code” button and then “Download ZIP” to save the file on your computer.
2. Unzip the file,
3. Open Command Prompt or Terminal and navigate to the unzipped folder (chatGPT-discord-bot-main). Or you can open the folder and launch Command Prompt or Terminal from there by right-clicking and selecting the option.
4. Run the following command to install the required packages.
pip3 install -r requirements.txt
5. Open the
.env.dev file in the unzipped folder and enter your Discord bot token and the OpenAI API key.
Alternatively, you may use your session token and OpenAI login email and password to pass the authentication instead of the API key. This method is not guaranteed to work but if you don’t have an OpenAI API key or have run out of credits, you can use this method.
6. Save the file and rename it to
7. Run the following command from the root directory to start the ChatGPT Discord bot.
If all goes well, you should see a status that says your Discord bot is running.
And so that’s how we can easily integrate ChatGPT with Discord and add ChatGPT to Discord. You can now chat with ChatGPT from Discord. Don’t forget to start your prompt with
/chat to summon the ChatGPT Discord bot.
The ChatGPT Discord bot will respond in a few seconds with the answer.
If you want to generate images with the ChatGPT Discord bot, use the
/draw command before your prompt.
There a several other fun as well as useful things that you can do with the ChatGPT bot in Discord. In the section below, you’ll find the ways to use the various features of the ChatGPT bot in Discord.
How to use ChatGPT in Discord
After you’ve integrated ChatGPT with Discord and added the ChatGPT Discord bot to your server, you’ll be able to chat and interact with ChatGPT as you would on chat.openai.com. You also get enhanced functionality such as the ability to generate images and ready accessibility of multiple personas.
Here’s how you can use ChatGPT in Discord.
- To chat with ChatGPT on Discord, use the command
/chatand followed by the prompt. Example: /chat Who was the first first lady of the US?
- To generate an image from text, use the
/drawcommand followed by your prompt.
- To switch personas, use the
/switchpersonacommand and select one of the personas from the options.
- To switch to a private mode use /private command.
There are some other modes and features. You can find them here.
Some recommended articles