1672446360
A simple Discord bot that integrates OpenAI's ChatGPT. Developed using discord.js, discordx, and chatgpt-api. This is also my first project written in TypeScript!
This package requires a valid session token from ChatGPT to access it's unofficial REST API.
To get a session token:
Application
> Cookies
. __Secure-next-auth.session-token
and save it to your .env
file (which will be covered next).First, clone the repo using git:
git clone https://github.com/imedra/Maple
Second, install the required dependencies.
npm install
Third, create a .env
file in the root directory and fill out the required fields
discord_token = Insert Discord Token Here
openai_token = Insert OpenAI Token Here
Finally, run ``npm run start` and enjoy!
Author: imedra
Source code: https://github.com/imedra/discordCGPT
License: MIT license
1672446360
A simple Discord bot that integrates OpenAI's ChatGPT. Developed using discord.js, discordx, and chatgpt-api. This is also my first project written in TypeScript!
This package requires a valid session token from ChatGPT to access it's unofficial REST API.
To get a session token:
Application
> Cookies
. __Secure-next-auth.session-token
and save it to your .env
file (which will be covered next).First, clone the repo using git:
git clone https://github.com/imedra/Maple
Second, install the required dependencies.
npm install
Third, create a .env
file in the root directory and fill out the required fields
discord_token = Insert Discord Token Here
openai_token = Insert OpenAI Token Here
Finally, run ``npm run start` and enjoy!
Author: imedra
Source code: https://github.com/imedra/discordCGPT
License: MIT license
1675759267
Build your own Discord bot using ChatGPT
Warning
2023-02-03 Update: ChatGPT API working again
2023-02-02 Update: OpenAI has closed ChatGPT API, temporarily switching to using GPT-3 model
2023-02-01 Update: Now using the official ChatGPT API
/chat [message]
Chat with ChatGPT!/private
ChatGPT switch to private mode/public
ChatGPT switch to public mode/reset
ChatGPT conversation history will be erasedpublic 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
Setup
pip install -r requirements.txt
config.dev.json
to config.json
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 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 botBuild 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 botA starting prompt would be invoked when the bot is first started or reset
You can set it up by modifying the content in starting-prompt.txt
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!
Right-click the channel you want to recieve the message, Copy ID
paste it into config.json
under discord_channel_id
Author: Zero6992
Source Code: https://github.com/Zero6992/chatGPT-discord-bot
License: GPL-2.0 license
1623907860
This is the same old bot running on the Discord Server of CSUL, but i’ve changed the code. It’s better now.
The bot is now running on Heroku servers, using only free features. There are some new commands on Heroku CLI that can be a problem if you don’t pay attention.
I’ll list some things i almost miss while read the documentations, on the first attempt to host this bot.
#robot #discord #csul discord bot for python #csul #csul discord bot
1672389360
packages that I use: discord.js, openai
Clone the repo on your system:
git clone https://github.com/3raphat/simple-discord-bot-template.git
Then, navigate to the directory and install the npm packages:
npm install
Rename .env.example
to .env
and fill out the values:
TOKEN=
CLIENT_ID=
OPENAI_API_KEY=
Go to https://beta.openai.com/account/api-keys.
Click on Create new secret key
button.
Copy the OpenAI API key, then paste it into the OPENAI_API_KEY
in .env
file.
npm run start
After run the bot, use node deploy-commands.js
to deploy the slash commands.
Author: 3raphat
Source code: https://github.com/3raphat/chatGPT-discord-bot
License: MIT license
1672147740
A discord bot for interact with ChatGPT
git clone https://github.com/MrlolDev/chatgpt-discord-bot.git
2. Install dependencies.
npm install
3. Create a new .env file
# .env
TOKEN=Discord token id(https://discord.dev)
CLIENT_ID=Discord client id(https://discord.dev)
SUPABASE_KEY=Supabase key(https://app.supabase.com)
SUPABASE_URL=Supabase url(https://app.supabase.com)
SESSION_TOKEN="replace with your open ai session key"
API_TOKEN=Get it from https://justbrowse.io
4. Run the bot
node .
Author: MrlolDev
Source Code: https://github.com/MrlolDev/chatgpt-discord-bot
License: Apache-2.0 license