This Golang project is a Discord bot that interacts with ChatGPT, a conversational AI-powered chatbot platform.
- You need to have access to Discord Development token. You can read more about Discord tokens and applications here.
- You will also need OpenAI development key. More about OpenAI API.
Your Discord bot needs the following permissions in order to work:
- Send Message
This corresponds to the following permission integer: 2048
Make sure that your Discord bot has MESSAGE CONTENT INTENT permission enabled.
First, build Golang program using
go build -o chatgpt-bot ./...This command will generate executable. You can run the bot using following command:
DISCORD_AUTH_TOKEN=XXXX OPENAI_AUTH_TOKEN=sk-XXXX ./chatgpt-botTo use bot in Discord, simply tag the bot and interact.