This a very basic discord bot linking to GPT3 (openai and AI21). By defaults it is Kirby, but can be any real or virtual bot (just need more or less training prompt).
NOTE: More features are available in the Rust version: https://github.com/AlexisTM/discord-god-rust
This is an OpenAI discord bot replying as Kirby.
Environment keys:
Come and test on Discord!: https://discord.gg/Y8XPcj2Q
Kirby are you there?
: Replies yes if the server runsKirby enable
: Allow Kirby god to randomly jump into conversations (15% chance of reply)
Kirby disable
: Disable the Kirby mode of the channelKirby god:
: Answers as a Kirby god.
Kirby clean
Marv:
=> Answers as a chatbot that reluctantly answers questions. Not maintained ;)git clone https://github.com/AlexisTM/gpt3-discord-bot
cd gpt3-discord-bot
python3 -m pip install -r requirements.txt --user
export DISCORD_BOTOKEN="sometoken"
export OPENAI_KEY="someothertoken"
export AI21_API_KEY="yetanothertoken"
python3 main.py
Notes:
Create a bot application: https://discordpy.readthedocs.io/en/stable/discord.html
Configure intents for your bot: https://discordpy.readthedocs.io/en/stable/intents.html
In the oauth section of discord dev portal, make a link to allow your bot to join your server such as:
https://discord.com/api/oauth2/authorize?client_id=APPID&permissions=2215115840&scope=bot
In this case, we only need the bot scope and READ/WRITE messages permissions/