⭐️ If this repo helps you, a star is the biggest support for me and also helps you stay up-to-date
Warning
/chat [message]
Chat with ChatGPT!/private
ChatGPT switch to private mode/public
ChatGPT switch to public mode/reset
ChatGPT conversation history will be erased
/start
Start up ChatGPT!/reset
ChatGPT conversation history will be erased
-
public 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
- Change the file name of
.env.example
to.env
-
Go to https://discord.com/developers/applications create an application
-
Build a Discord bot under the application
-
Get the token from bot setting
-
Store the token to
.env
under theDISCORD_BOT_TOKEN
-
Turn MESSAGE CONTENT INTENT
ON
-
Invite your bot to your server via OAuth2 URL Generator
Enable
bot
andapplications.commands
scopes, copy the generated URL and paste it into your browser
-
Click Create new secret key
-
Store the SECRET KEY to
.env
under theOPENAI_TOKEN
- Open a terminal or command prompt
- Navigate to the directory where you installed the ChatGPT Discord bot
- Run
python3 main.py
to start the bot
- Build the Dcoker image & Run the Docker container
docker compose up -d
- Inspect whether the bot works well
docker logs -t chatgpt-discord-bot
OR
- sh start.sh
docker ps
to see the list of running servicesdocker stop <BOT CONTAINER ID>
to stop the running bot
OR
- sh stop.sh
-
A starting prompt would be invoked when the bot is first started or reset
-
You can set it up by modifying the content in
.env.example.CUSTOM_BASE_PROMPT
-
All the text in the file will be fired as a prompt to the bot
-
Get the first message from ChatGPT in your discord channel!