Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/m1guelpf/chatgpt-discord
Run your own GPTChat Discord bot, with a single command!
https://github.com/m1guelpf/chatgpt-discord
Last synced: 4 days ago
JSON representation
Run your own GPTChat Discord bot, with a single command!
- Host: GitHub
- URL: https://github.com/m1guelpf/chatgpt-discord
- Owner: m1guelpf
- License: mit
- Created: 2022-12-08T18:24:28.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2022-12-20T20:25:56.000Z (about 2 years ago)
- Last Synced: 2024-05-22T11:32:30.107Z (8 months ago)
- Language: Go
- Homepage:
- Size: 36.1 KB
- Stars: 292
- Watchers: 6
- Forks: 56
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome - m1guelpf/chatgpt-discord - Run your own GPTChat Discord bot, with a single command! (Go)
- awesome-chatgpt-tools - ChatGPT for Discord Bot
- awesome-chatgpt - chatgpt-discord - Discord bot. (Bots / Examples)
- fucking-awesome-chatgpt - ChatGPT for Discord Bot
- awesome-chatgpt - ChatGPT for Discord Bot
- awesome-ChatGPT-repositories - chatgpt-discord - Run your own GPTChat Discord bot, with a single command! (Chatbots)
- awesome-chatgpt - ChatGPT for Discord Bot
- stars - m1guelpf/chatgpt-discord - Run your own GPTChat Discord bot, with a single command! (Go)
- awesome-chatgpt - chatgpt-discord
- awesome-chatgpt - chatgpt-discord - Discord bot. (Bots / Examples)
- awesome-gpt - ChatGPT for Discord Bot
- Awesome-ChatGPT - ChatGPT for Discord Bot
- awesome-chatgpt-zh - Discord Bot η ChatGPT
- awesome-ChatGPT-resource-zh - γDiscord Botγ
README
# ChatGPT Discord Bot
Go CLI to power a Discord bot letting you interact with [ChatGPT](https://openai.com/blog/chatgpt/), a large language model trained by OpenAI, collaboratively in Discord servers or privately in your DMs.
## Installation
Download the file corresponding to your OS in the [releases page](https://github.com/m1guelpf/chatgpt-discord/releases/latest):
- `chatgpt-discord-Darwin-amd64`: macOS (Intel)
- `chatgpt-discord-Darwin-arm64`: macOS (M1)
- `chatgpt-discord-Linux-amd64`: Linux
- `chatgpt-discord-Linux-arm64`: Linux (ARM)
- `chatgpt-discord-Win-amd64`: WindowsAfter you download the file, extract it into a folder and open the `env.example` file with a text editor and fill in your credentials. You'll need your bot token, which you can find [here](https://www.writebots.com/discord-bot-token/), and optionally (if you want to prevent anyone else from using the bot) your Discord username. Save the file, and rename it to `.env`.
> **Note** Make sure you rename the file to _exactly_ `.env`! The program won't work otherwise.
Finally, open the terminal in your computer (if you're on windows, look for `PowerShell`), navigate to the path you extracted the above file (you can use `cd dirname` to navigate to a directory, ask ChatGPT if you need more assistance π) and run `./chatgpt-discord`.
## Authentication
By default, the program will launch a browser for you to sign into your account, and close it once you're signed in. If this setup doesn't work for you (there are issues with the browser starting, you want to run this in a computer with no screen, etc.), you can manually extract your session from your browser instead.
To do this, first sign into ChatGPT on your browser, then open the Developer Tools (right click anywhere in the page, then click "Inspect"), click on the Application tab and then on the Cookies section, and copy the value of the `__Secure-next-auth.session-token` cookie.
You will then have to create a config file in the following location depending on your OS (replace `YOUR_USERNAME_HERE` with your username:
- `~/.config/chatgpt.json`: Linux
- `C:\Users\YOUR_USERNAME_HERE\AppData\Roaming\chatgpt.json`: Windows
- `/Users/YOUR_USERNAME_HERE/Library/Application Support/chatgpt.json`: macOS> **Note** If you have already run the program, the file should exist but be empty. If it doesn't exist yet, you can either run the program or manually create it.
Finally, add your cookie to the file and save it. It should look like this: `{ "openaisession": "YOUR_COOKIE_HERE" }`.
## License
This repository is licensed under the [MIT License](LICENSE).