/talk [message]
Chat with ChatGPT!/locations
List locations you can travel to/travel
Travel to a location, swapping out the NPCs
-
public mode (default)
the bot directly reply on the channel -
private mode
the bot's reply can only be seen by the person who used the command -
replyall mode
the bot will reply to all messages in the channel without using slash commands (/chat
will also be unavailable)Warning The bot will easily be triggered in
replyall
mode, which could cause program failures
-
run
pip3 install -r requirements.txt
-
Rename the file
.env.example
to.env
-
Recommended python version
3.9
+
-
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
Note
In Step 2, you only need to complete the authentication process for the model you want to use (it's not necessary to complete all Step 2)
Remember to modify
CHAT_MODEL
to the default model you want to use in.env
file
-
Click Create new secret key
-
Store the SECRET KEY to
.env
under theOPENAI_API_KEY
-
Open a terminal or command prompt
-
Navigate to the directory where you installed the ChatGPT Discord bot
-
Run
python3 main.py
orpython main.py
to start the bot
-
Build the Docker image & Run the Docker container
docker 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 bot