Mary  Turcotte

Mary Turcotte

1672446360

A Simple Discord Bot That integrates OpenAI's ChatGPT

discordCGPT

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!

Prerequisites

How to aquire a ChatGPT Token (Credit Travis Fischer/chatgpt-api)

This package requires a valid session token from ChatGPT to access it's unofficial REST API.

To get a session token:

  1. Go to https://chat.openai.com/chat and log in or sign up.
  2. Open dev tools.
  3. Open Application > Cookies. ChatGPT cookies
  4. Copy the value for __Secure-next-auth.session-token and save it to your .env file (which will be covered next).

Setup

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!

Credits


Download details:

Author: imedra
Source code: https://github.com/imedra/discordCGPT

License: MIT license

#chatgpt #openai #discord 

What is GEEK

Buddha Community

A Simple Discord Bot That integrates OpenAI's ChatGPT
Mary  Turcotte

Mary Turcotte

1672446360

A Simple Discord Bot That integrates OpenAI's ChatGPT

discordCGPT

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!

Prerequisites

How to aquire a ChatGPT Token (Credit Travis Fischer/chatgpt-api)

This package requires a valid session token from ChatGPT to access it's unofficial REST API.

To get a session token:

  1. Go to https://chat.openai.com/chat and log in or sign up.
  2. Open dev tools.
  3. Open Application > Cookies. ChatGPT cookies
  4. Copy the value for __Secure-next-auth.session-token and save it to your .env file (which will be covered next).

Setup

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!

Credits


Download details:

Author: imedra
Source code: https://github.com/imedra/discordCGPT

License: MIT license

#chatgpt #openai #discord 

Nat  Grady

Nat Grady

1675759267

ChatGPT-discord-bot: Integrate ChatGPT Into Your Own Discord Bot

ChatGPT Discord Bot

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

Features

  • /chat [message] Chat with ChatGPT!
  • /private ChatGPT switch to private mode
  • /public ChatGPT switch to public mode
  • /reset ChatGPT conversation history will be erased

Chat

image

Mode

public mode (default) the bot directly reply on the channel

image

private mode the bot's reply can only be seen by the person who used the command

image

Setup

Install

  1. pip install -r requirements.txt
  2. Rename the file config.dev.json to config.json

Step 1: Create a Discord bot

Go to https://discord.com/developers/applications create an application

Build a Discord bot under the application

Get the token from bot setting

image

Store the token to config.json under the discord_bot_token

image

Turn MESSAGE CONTENT INTENT ON

image

Invite your bot to your server via OAuth2 URL Generator

image

Step 2: Geanerate a OpenAI API key

Go to https://beta.openai.com/account/api-keys

Click Create new secret key

image

Store the SECRET KEY to config.json under the openAI_key

Step 3: Run the bot on the desktop

  1. Open a terminal or command prompt
  2. Navigate to the directory where you installed the ChatGPT Discord bot
  3. Run python3 main.py to start the bot

Step 3: Run the bot with Docker

Build the Docker image & Run the Docker container docker compose up -d

Inspect whether the bot works well docker logs -t chatgpt-discord-bot

Stop the bot:

  • docker ps to see the list of running services
  • docker stop <BOT CONTAINER ID> to stop the running bot

Have a good chat!

Optional: Setup starting prompt

A 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

channel-id

paste it into config.json under discord_channel_id

Download Details:

Author: Zero6992
Source Code: https://github.com/Zero6992/chatGPT-discord-bot 
License: GPL-2.0 license

#chatgpt #bot #discord #discordbot 

Ray  Patel

Ray Patel

1623907860

CSUL Discord Bot for python

Cruzeiro

This is the same old bot running on the Discord Server of CSUL, but i’ve changed the code. It’s better now.

How i did

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

Mary  Turcotte

Mary Turcotte

1672389360

ChatGPT But Discord Bot Version using Discord.js and Openai

chatGPT-discord-bot

packages that I use: discord.js, openai

Installation

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

Configuration

Rename .env.example to .env and fill out the values:

TOKEN=
CLIENT_ID=
OPENAI_API_KEY=

How to generate a 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.

Start

npm run start

After run the bot, use node deploy-commands.js to deploy the slash commands.


Download details:

Author: 3raphat
Source code: https://github.com/3raphat/chatGPT-discord-bot

License: MIT license

#discord #chartgpt #openai 

Noelia  Douglas

Noelia Douglas

1672147740

Chatgpt Bot: A Discord Bot for interact with ChatGPT

chatgpt-bot

A discord bot for interact with ChatGPT

Setup Guide

  1. Clone repository
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 .

Get session key

  1. Go to https://chat.openai.com/chat
  2. Log in to your account
  3. Open developer tools
  4. Go to the application section
  5. Go to the cookies section
  6. And get your session token which is the cookie with the name: "__Secure-next-auth.session-token"

TO DO:

  •  Chat command with ChatGPT response. --> 0.0.2
  •  Conversations support(the bot have context from the previous messages). --> 0.0.3
  •  Bot command(get information about the bot and the ping bot). --> 0.0.3
  •  Feedback command(allow people to send feedback). --> 0.0.4
  •  Auto refresh session token --> 0.0.5
  •  Includes user message in chat command. --> 0.0.6
  •  Solve ChatGPT issues --> 0.0.6
  •  Limits to 1 conversation per channel. --> 0.0.6
  •  Host on vps server --> 0.0.7
  •  Allow private conversations --> 0.0.9
  •  Embeds --> 0.0.9
  •  Top.gg rewards --> Future
  •  Partials responses during loading --> Future
  •  Uptime Robot alerts --> Future

Download Details:

Author: MrlolDev
Source Code: https://github.com/MrlolDev/chatgpt-discord-bot

License:  Apache-2.0 license

#chatgpt #discord