ChatGPT Discord Bot powered by NodeJS

God bless the internet

ChatGPT Discord Bot powered by NodeJS for AI is available on Github.

NodeJS (Self-hosted) ChatGPT Discord Bot

Welcome to our work-in-progress Discord bot, designed to help GBTI members get a head start in creating their own self-hosted ChatGPT Discord bots.

This bot integrates with the OpenAI API as well as the Discord API through a config.json file. Full setup instructions are being developed and will be made available in our private repo.

It does require you to have a payment account linked with OpenAI, to record data usage, but the data appears to be affordable, currently, at the time of this article a power user costs about 10 cents a day and a regular user not even a cent.

You’ll definitely need to monitor your usage but the OpenAI API provides for decent throttle management.

Once this bot is connected to your discord, you’ll want to assign it to a special channel where your users will go to interact act with it. And then your users will type in /chat prompt to create a private thread between themselves and ChatGPT, or /chat prompt --public to open a public, collaborative thread.

We currently have made it so that public threads will accept collaborative input from multiple parties. Private threads will only allow the initiating user to participate.

We have also are recording up to 50 interactions per thread to remember so the AI will retain a well context of everything that was talked about prior. Note, this can increase expense as the larger the context inputs become, the more characters/credits are used per interaction, so you might want to manually reduce the number of replies to remember inside the codebase itself.

If you have any troubles or questions about installation, feel free to ask directly into the discord. We’re open to improving this asset as well as advising others on how to improve it.

Why selfhost a ChatGPT bot?

Self-hosting a Discord bot gives you more control over your bot and the server it runs on. Here are a few reasons why you might want to self-host your Discord bot:

  1. Cost: Leasing or renting a bot from a 3rd party can be expensive, especially if you want to run your bot 24/7. By self-hosting your bot, you can save money on hosting costs and only pay for what you need.
  2. Customization: When you self-host your bot, you have complete control over its functionality and can customize it to fit your needs. You can add new features, integrate it with other services, and make changes to the code as needed.
  3. Privacy: When you use a 3rd-party bot hosting service, your data and messages may be accessible to the hosting provider. By self-hosting your bot, you can ensure that your data stays private and secure.
  4. Scalability: When you self-host your bot, you can easily scale it up or down as needed. You can add more resources to your server to handle more traffic, or scale it down if you need to save money.

Overall, self-hosting your Discord bot can give you more control, flexibility, and cost savings over leasing or renting a bot from a 3rd party; however, it requires more technical knowledge and can be more time-consuming to set up and maintain. Our model is for the DIY developer.

There is an official bot provided by OpenAI

At the time of creating this asset, we are aware of some powerful interpretations of a ChatGPT Discord bot, but we are not aware of anything issued by OpenAI themselves.

You can still consider this bot model a starting part for other similar AI powered language models.

Support our work

Support the GBTI network by becoming a member of our private community.

Become a supporter and join the GBTI Community.