This is a project that provides you to build your own Discord bot using ChatGPT
⭐️ If this repo helps you, a star is the biggest support for me and also helps you stay up-to-date
Warning
2022-12-15 Update: Cloudflare are currently preventing the bot from receiving any further messages, so the bot is using the official GPT-3 API until this chaos about cat catching mice ends
2022-12-12 Update: OpenAI added Cloudflare protections to their API in ChatGPT, there are some differences in using it on server and desktop environment
/chat [message]
Chat with ChatGPT!/private
ChatGPT switch to private mode/public
ChatGPT switch to public modepublic mode (default)
the bot directly reply on the channel
private mode
the bot’s reply can only be seen by who use the command
pip install -r requirements.txt
Get the token from bot setting
config.dev.json
to config.json
Store the token to config.json
under the discord_bot_token
Turn MESSAGE CONTENT INTENT ON
Invite your bot to your server via OAuth2 URL Generator
Go to https://beta.openai.com/account/api-keys
Click Create new secret key
Store the SECRET KEY to config.json
under the openAI_key
python3 main.py
to start the botdocker compose up -d
Inspect whether the bot works well docker logs -t chatgpt-discord-bot
docker ps
to see the list of running servicesdocker stop <BOT CONTAINER ID>
to stop the running botstarting-prompt.txt
Get the first message from ChatGPT in your discord channel!
Right-click the channel you want to recieve the message, Copy ID
paste it into config.json
under discord_channel_id