Skip to content

🤖 Simple ChatGPT Bot for a small team or personal use. Quick Deploy, Easy Config, Simple Usage

Notifications You must be signed in to change notification settings

jasonfoknxu/chatgpt-bot-discord-telegram-azure

Repository files navigation

ChatGPT Bot 🤖

Simple ChatGPT Bot

(^ AI generated illustration from the ChatGPT Logo)

Simple ChatGPT Bot for a small team or personal use.

Quick Deploy, Easy Config, Simple Usage

📖 Features

  • Support Discord & Telegram
  • Selectable Chat Mode: Group Chat & Individual
  • Easy to config
  • Ready to run: 🐳 docker compose or ⚙️ PM2
  • Using Azure OpenAI
  • Lightweight source code
  • Flexible development design

💬 Chat Mode

Mode Name Description
1 Default Discord bot for group chat, Telegram bot for individual. Suitable for a small team/group of people.
2 Individual Both Discord bot & Telegram bot will separate chat for each user. (1-to-1 chat)
3 Seamless All chats of Discord bot and Telegram bot will count as the same conversation. Useful for personal.

⚒️ Configuration

Config Variable Data Type Description
DISCORD_BOT_TOKEN string The token of the Discord bot. If no token is provided, discord bot will be disabled.
DISCORD_ALLOW_CHANNELS string A comma-separated (,) whitelist of Discord channel IDs. The bot will only responsive in the channels from the list.
TELEGRAM_BOT_TOKEN string The token of the Telegram bot. If no token is provided, telegram bot will be disabled.
TELEGRAM_ALLOW_USERS string A comma-separated (,) whitelist of Telegram user IDs. The bot will only responsive to the users from the list.
AZURE_ENDPOINT string The endpoint URL of the Azure OpenAI service.
AZURE_DEPLOYMENT_NAME string The deployment name of the Azure OpenAI service.
AZURE_KEY string The key of the Azure OpenAI service.
CHAT_MODE number Choose the chat mode. Refer to the Chat Mode section.
ALWAYS_SYSTEM_PROMPT boolean Send system prompt to ChatGPT in each request? This can make ChatGPT keep remember the system prompt to provide better responsive in some cases, but more prompt tokens will be used.
SYSTEM_PROMPT string The system prompt for ChatGPT (optional)

💡 How to use?

  1. You must have enabled the Azure OpenAI services
  2. You must created a Discord Application / Telegram Bot
  3. git clone to download the source code
  4. Copy the sample.env file and rename as .env
  5. Edit the config in the .env file
  6. If you want to use ⚙️ PM2, run yarn run init:pm2
  7. If you want to use 🐳 docker compose, run yarn run docker (:warning: This project will not build a docker image, it use the node image to run the bot and manage with docker)
  8. The bot will be run in the background

About

🤖 Simple ChatGPT Bot for a small team or personal use. Quick Deploy, Easy Config, Simple Usage

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published