Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/flows-network/discord-chatgpt

A Discord ChatGPT Bot
https://github.com/flows-network/discord-chatgpt

automation chatgpt discord discord-chatgpt rust

Last synced: 3 months ago
JSON representation

A Discord ChatGPT Bot

Awesome Lists containing this project

README

        

#

A Discord ChatGPT bot




flows.network Discord


flows.network Twitter


Create a flow

[Deploy this function on flows.network](https://flows.network/flow/createByTemplate/discord-chatgpt), and you will get a Discord bot that uses ChatGPT to respond to every question in your Discord DM.

## Prerequisites

* You will need to bring your own [OpenAI API key](https://openai.com/blog/openai-api). If you do not already have one, [sign up here](https://platform.openai.com/signup).
* You also need a bot token to access the Discord API. Please refer to [How to create a Discord chat bot](https://flows.network/blog/discord-chat-bot-guide) to save the Discord API Token and invite the bot to your server. You can see the bot is offline now. But don't worry! After you finish all the steps, the bot will be online.

## Deploy your Telegram ChatGPT bot in 3 steps

1. Create a bot from a template
2. Add your ChatGPT API key
3. Add the Discord bot token

### 1 Create a bot from a template

[**Just click here**](https://flows.network/flow/createByTemplate/discord-chatgpt)

image

Here you can see three variables. You can customize the `system_prompt` variable to prompt ChatGPT.

Click on the **Create and Build** button.

### 2 Add the Discord token

You will now set up Discord integration. Enter your Discord token here. Please refer to [How to create a Discord chat bot](https://flows.network/blog/discord-chat-bot-guide).

image

Click on **Continue**.

### 3 Add your OpenAI API key

You will now set up OpenAI integration. Click on **Connect**, and enter your key.

[image](https://user-images.githubusercontent.com/45785633/226564674-902933b5-8ff3-4724-93e3-2b2f67dc0b9a.png)

Close the tab and go back to the flow.network page once you are done. Click on **Deploy** button.

## Give it a try.

When the status of the flow is ready and running, you can go back to your Discord server and check out the status of the bot you just invited.

Now you can see the bot on the right `online` contact list. DM the bot or @the bot in a channel, the bot will answer your questions.

## Others

If you want to build locally, make sure you have installed Rust and added `wasm32-wasi` traget.

```
cargo build --target wasm32-wasi --release
```