Back to rankings

zhayujie/bot-on-anything

Pythoncowagent.ai

A large model-based chatbot builder that can quickly integrate AI models (including ChatGPT, Claude, Gemini) into various software applications (such as Telegram, Gmail, Slack, and websites).

chatgptgmailtelegramslackwebclaudegemini
Star Growth
Stars
4.2k
Forks
911
Weekly Growth
โ€”
Issues
263
2k4k
Feb 2023Mar 2024May 2025Jul 2026
ArtifactsPyPIpip install bot-on-anything
README

Bot-On-Anything

Latest release License: MIT Stars
[English] | [ไธญๆ–‡]

Bot on Anything is a lightweight framework for building AI chatbots. With a bit of configuration you can connect various large models to different application channels โ€” a great fit for quickly spinning up bots on overseas channels like Telegram, Slack, Discord, and Gmail.

Need a more complete Agent โ€” task planning, long-term memory, skills, MCP, self-evolution and more? Check out our other project CowAgent. See Related Projects.


Introduction

With a single config file, you pick one connection between a large model and an application channel, get a chatbot running, and switch between different paths anytime within the same project. Models and channels are independent: adding a channel reuses existing models, and adding a model works across all channels.


๐ŸŒŸ Highlights

Capability Description
Multiple models OpenAI (GPT-5.5 / GPT-4.1, etc.), LinkAI (one key for 100+ models: DeepSeek, Claude, Gemini...), ERNIE Bot, New Bing, Bard โ€” switch by changing the type field
Multiple channels Terminal, Web, WeChat Subscription / Service Account, Enterprise WeChat, QQ, Telegram, Gmail, Slack, DingTalk, Feishu, Discord โ€” 12 channels
Decoupled models & channels Models and channels are not bound together; any model runs on any channel, and adding one side reuses the other
Parallel channels List multiple channels in one config and start them together as separate processes without interference
Plugin support Compatible with the plugin model of chatgpt-on-wechat โ€” extend with image generation, model selectors, and more
Lightweight deploy Pure Python, runs with just a few lines of config

๐Ÿš€ Quick Start

1. Runtime Environment

Works on Linux, MacOS, and Windows. Python is required โ€” version 3.7.1~3.10 is recommended.

Clone the code and install dependencies:

git clone https://github.com/zhayujie/bot-on-anything
cd bot-on-anything/
pip3 install -r requirements.txt

2. Configuration

The core config file is config.json. The project ships with a template config-template.json โ€” just copy it to get the actual config:

cp config-template.json config.json

Each model and channel has its own config block, which together form the full config file. The overall structure looks like this:

{
  "model": {
    "type" : "openai",             # the AI model to use
    "openai": {
      # openAI config
    }
  },
  "channel": {
    "type": "slack",            # the channel to connect
    "slack": {
        # slack config
    },
    "telegram": {
        # telegram config
    }
  }
}

At the top level the config splits into model and channel: model is the model config, whose type picks which model to use; channel is the channel config, whose type picks which channel to connect (it can also be an array to start several channels at once).

Day to day, you just change these two type fields to switch between different models and channels. Each model and channel is described below, with configuration and how to run it (click to expand).

3. Running

Run the following in the project root โ€” the default channel is the terminal:

python3 app.py

๐Ÿค– Models

Model Description
OpenAI Works with the OpenAI-compatible chat API โ€” GPT-5.5 / GPT-4.1 and other models, or any compatible gateway via api_base
LinkAI One key for 100+ models including DeepSeek, Claude, Gemini, Qwen, GLM, and more
ERNIE Bot Based on Baidu ERNIE Bot's web version
New Bing Based on Bing chat, supports jailbreak mode
Bard Based on Google Bard's web version

For models from other providers (DeepSeek, Claude, Gemini...), use LinkAI โ€” one key covers them all โ€” or CowAgent.

OpenAI

Uses the OpenAI-compatible chat API. Set model to any model your endpoint supports (e.g. gpt-5.5, gpt-4.1), or point api_base to a compatible gateway to use other providers. See the official docs for details.

Install dependencies

pip3 install "openai<1.0.0"

Note: this project uses the legacy openai SDK (0.27.x+ but below 1.0.0) โ€” requirements.txt already pins a compatible version. If installation fails, upgrade pip first with pip3 install --upgrade pip.

Configuration

{
  "model": {
    "type" : "chatgpt",
    "openai": {
      "api_key": "YOUR API KEY",
      "api_base": "",                                   # optional, an OpenAI-compatible endpoint
      "model": "gpt-5.5",                               # model name
      "proxy": "http://127.0.0.1:7890",                 # proxy address
      "character_desc": "You are ChatGPT, a large language model trained by OpenAI...",
      "conversation_max_tokens": 1000,                  # max reply length, total of input and output
      "temperature":0.75,     # entropy in [0,1]; higher means more random word choices
      "top_p":0.7,            # candidate word list; 0.7 means only the top 70% of candidates are considered
      "frequency_penalty":0.0,            # in [-2,2]; higher reduces word repetition in a line
      "presence_penalty":1.0,             # in [-2,2]; higher is less constrained by the input
    }
}
  • api_key: the OpenAI API KEY created when you registered your account
  • api_base (optional): an OpenAI-compatible endpoint; leave empty for the official API, or point it to a compatible gateway to use other providers
  • model: any model your endpoint supports, e.g. gpt-5.5, gpt-4.1, gpt-4o (GPT-5 / o-series only accept default sampling params; this project skips them automatically)
  • proxy: proxy client address, see #56
  • character_desc: the bot's persona; the model plays this role, feel free to customize it
  • max_history_num (optional): max length of conversation memory; older memory is cleared beyond this

LinkAI

Configuration

{
  "model": {
    "type" : "linkai",
    "linkai": {
      "api_key": "",
      "api_base": "https://api.link-ai.tech",
      "app_code":  "",
      "model": "",
      "conversation_max_tokens": 1000,
      "temperature":0.75,
      "top_p":0.7,
      "frequency_penalty":0.0,
      "presence_penalty":1.0,
      "character_desc": "You are an intelligent assistant."
    },
}
  • api_key: the key for calling LinkAI, created in the console
  • app_code: the code of a LinkAI app or workflow, optional, see Creating an App
  • model: one key gives access to 100+ models (DeepSeek, Claude, Gemini, Qwen, GLM, GPT, etc.), see the model list; can be left empty and set the app's default model on the LinkAI platform
  • Other parameters have the same meaning as in the OpenAI model

ERNIE Bot

Based on Baidu ERNIE Bot's web version, needs a Cookie obtained manually.

{
  "model": {
    "type" : "baidu",
    "baidu": {
      "acs_token": "YOUR ACS TOKEN",
      "cookie": "YOUR COOKIE"
    }
  }
}
  • cookie: after logging into ERNIE Bot in the browser, grab it from the developer tools
  • acs_token: same as above, grab it from the request parameters; search for a tutorial if needed

New Bing

Based on Bing chat, depends on the EdgeGPT library, needs a Cookie after logging into Bing.

{
  "model": {
    "type" : "bing",
    "bing":{
      "jailbreak": true,
      "jailbreak_prompt": "...",
      "cookies": []
    }
  }
}
  • cookies: the array of cookies exported from the browser after logging into Bing
  • jailbreak: whether to enable jailbreak (Sydney) mode, which bypasses some of the official restrictions

Bard

Based on Google Bard's web version, needs a Cookie after logging in.

{
  "model": {
    "type" : "bard",
    "bard": {
      "cookie": "YOUR COOKIE"
    }
  }
}

๐Ÿ’ฌ Channels

Channel Description
Terminal Default channel, no extra config needed
Web Web-based chat, built on flask + socketio
Subscription Account Auto-reply for a personal WeChat subscription account
Service Account Verified WeChat service account, gets around the 5s timeout
QQ Depends on go-cqhttp, supports private and group chat
Telegram Telegram bot
Gmail Chat over email
Slack Slack bot, Socket Mode needs no public IP
DingTalk DingTalk enterprise internal bot
Feishu Feishu enterprise self-built app
Enterprise WeChat Enterprise WeChat self-built app
Discord Discord bot

Terminal

The config template starts the terminal by default โ€” no extra config needed. Run python3 app.py in the project directory to start it. Type right in the terminal to chat with the model, with streaming output supported.

terminal_demo.png

Web

Contributor: RegimenArsenic

Dependencies

pip3 install PyJWT flask flask_socketio

Configuration

"channel": {
    "type": "http",
    "http": {
      "http_auth_secret_key": "6d25a684-9558-11e9-aa94-efccd7a0659b",    // JWT auth secret key
      "http_auth_password": "6.67428e-11",        // auth password, for personal use, a basic defense against port scanning and DDOS wasting tokens
      "port": "80"       // port
    }
  }

Run locally: after python3 app.py, visit http://127.0.0.1:80.

Run on a server: after deploying, visit http://your-domain-or-IP:port.

Subscription Account

Requirements: a server and a subscription account.

1. Install dependencies

Install werobot:

pip3 install werobot

2. Configuration

"channel": {
    "type": "wechat_mp",
    "wechat_mp": {
      "token": "YOUR TOKEN",           # token value
      "port": "8088"                   # port the program listens on
    }
}

3. Run the program

Run python3 app.py in the project directory. If the terminal shows the following, it started successfully:

[INFO][2023-02-16 01:39:53][app.py:12] - [INIT] load config: ...
[INFO][2023-02-16 01:39:53][wechat_mp_channel.py:25] - [WX_Public] Wechat Public account service start!
Bottle v0.12.23 server starting up (using AutoServer())...
Listening on http://127.0.0.1:8088/
Hit Ctrl-C to quit.

4. Set the callback URL

Go to your subscription account in the WeChat Official Platform and enable server configuration:

wx_mp_config.png

Server address (URL): if you can reach the program on your server through this URL in a browser (default port 8088), the config is valid. Since subscription accounts only allow ports 80/443, either make the program listen on port 80 directly (needs sudo) or forward it with a reverse proxy like nginx. A public IP or a domain both work here.

Token: must match the token in config.json.

For the detailed process, see the official docs.

Note: after a user sends a message, WeChat pushes it to the configured URL, but if there's no reply within 5 seconds it disconnects and retries 3 times, while model requests often take longer than 5s. This project uses async and caching to stretch the limit to 15s, but beyond that it still can't reply in time. For time-sensitive scenarios, use the "Service Account" instead.

Service Account

Requirements: a server and a WeChat-verified service account.

The service account calls the model asynchronously first, then pushes the result to the user via the customer-service API, which gets around the subscription account's 15s timeout. Its developer-mode config is similar to the subscription account's โ€” see the official docs.

In the config, just change type to wechat_mp_service, keep reusing the wechat_mp block, and add app_id and app_secret:

"channel": {
    "type": "wechat_mp_service",
    "wechat_mp": {
      "token": "YOUR TOKEN",            # token value
      "port": "8088",                   # port the program listens on
      "app_id": "YOUR APP ID",          # app ID
      "app_secret": "YOUR APP SECRET"   # app secret
    }
}

Note: add the server IP to the "IP whitelist", otherwise users won't receive pushed messages.

QQ

Requirements: a PC or server (mainland China network) and a QQ account.

Running a QQ bot also needs a separate go-cqhttp process, which handles sending and receiving QQ messages, while this project requests the model and generates replies.

1. Download go-cqhttp

Download the build for your system from the go-cqhttp Release, unzip it, and put the go-cqhttp binary in bot-on-anything/channel/qq. There's already a config.yml there โ€” just fill in your QQ account (account-uin).

2. Install aiocqhttp

Use aiocqhttp to talk to go-cqhttp:

pip3 install aiocqhttp

3. Configuration

Just change the channel type in config.json to qq:

"channel": {
    "type": "qq"
}

4. Running

Terminal 1, in the project root (listens on port 8080):

python3 app.py

Terminal 2, in the go-cqhttp directory:

cd channel/qq
./go-cqhttp

Note: there's no keyword matching or group whitelist yet, so all private chats get auto-replies, and in group chats it replies whenever it's @-mentioned. If you hit issues like a frozen account, change protocol in device.json from 5 to 2, see this Issue.

Telegram

Contributor: brucelt1993

1. Get the token

You can search for how to create a Telegram bot โ€” the key thing is getting the bot's token id.

2. Install dependencies

pip install pyTelegramBotAPI

3. Configuration

"channel": {
    "type": "telegram",
    "telegram":{
      "bot_token": "YOUR BOT TOKEN ID"
    }
}

Gmail

Requirements: a server and a Gmail account.

Contributor: Simon

Follow the official docs to create an APP password for your Google account, then configure it like below:

"channel": {
    "type": "gmail",
    "gmail": {
      "subject_keyword": ["bot", "@bot"],
      "host_email": "xxxx@gmail.com",
      "host_password": "GMAIL ACCESS KEY"
    }
  }

Slack

โ‰ No longer needs a server or public IP

Contributor: amaoo

Dependencies

pip3 install slack_bolt

Configuration

"channel": {
    "type": "slack",
    "slack": {
      "slack_bot_token": "xoxb-xxxx",
      "slack_app_token": "xapp-xxxx"
    }
  }

Set bot token scopes - OAuth & Permission:

app_mentions:read
chat:write

Enable Socket Mode - Socket Mode: if you don't have an app-level token yet, you'll be prompted to create one; put it in slack_app_token.

Event Subscriptions - Subscribe to bot events:

app_mention

Reference: Slack Bolt for Python

DingTalk

Requirements: an enterprise internal development bot.

Dependencies

pip3 install requests flask

Configuration

"channel": {
    "type": "dingtalk",
    "dingtalk": {
      "image_create_prefix": ["draw", "draw", "Draw"],
      "port": "8081",                  # external port
      "dingtalk_token": "xx",          # access_token of the webhook URL
      "dingtalk_post_token": "xx",     # verification token in the header when DingTalk posts back
      "dingtalk_secret": "xx"          # security signing secret for the group bot
    }
  }

Create the bot

At https://open-dev.dingtalk.com/fe/app#/corp/robot , add a bot, then in the development settings fill in the server's outbound IP (run curl ifconfig.me on the host to get it) and the message-receiving address (the external address in your config, e.g. https://xx.xx.com:8081).

Reference: DingTalk internal bot tutorial ยท Enterprise internal bot tutorial

Feishu

Dependencies

pip3 install requests flask

Configuration

"channel": {
    "type": "feishu",
    "feishu": {
        "image_create_prefix": ["draw", "draw", "Draw"],
        "port": "8082",                  # external port
        "app_id": "xxx",                 # app_id
        "app_secret": "xxx",             # app secret
        "verification_token": "xxx"      # event subscription verification token
    }
}

Create the bot

At https://open.feishu.cn/app/ :

  1. Add an enterprise self-built app
  2. Grant permissions: im:message, im:message.group_at_msg, im:message.group_at_msg:readonly, im:message.p2p_msg, im:message.p2p_msg:readonly, im:message:send_as_bot
  3. In the event subscription menu, add the event (Receive messages v2.0) and set the request URL (the external address in your config, e.g. https://xx.xx.com:8081)
  4. Publish the app in version management; once approved, add the self-built app to your group

Enterprise WeChat

Requirements: a server and a verified Enterprise WeChat.

Just change type in config.json to wechat_com; the default message-receiving URL is http://ip:8888/wechat:

"channel": {
    "type": "wechat_com",
    "wechat_com": {
      "wechat_token": "YOUR TOKEN",            # token value
      "port": "8888",                          # port the program listens on
      "app_id": "YOUR APP ID",                 # app ID
      "app_secret": "YOUR APP SECRET",         # app secret
      "wechat_corp_id": "YOUR CORP ID",
      "wechat_encoding_aes_key": "YOUR AES KEY"
    }
}

Note: add the server IP to the "Enterprise trusted IP" list, otherwise users won't receive pushed messages.

Reference: Enterprise WeChat setup tutorial

Discord

Depends on discord.py:

pip3 install "discord.py>=2.0.0"

Configuration

"channel": {
    "type": "discord",
    "discord": {
        "app_token": "xxx",
        "channel_name": "xxx",
        "channel_session": "xxx"
    }
}
  • app_token: the Discord bot's Bot Token
  • channel_name: restrict the bot to a specific channel; leave empty to listen to all channels
  • channel_session: session granularity, author (per user) or thread (per thread)

General Configuration

  • clear_memory_commands: in-chat command to clear conversation memory; use a string array to define multiple aliases
    • default: ["#clear_memory"]

๐Ÿ”ง Plugin System

Following the plugin design of chatgpt-on-wechat, this project is also pluginized and stays as compatible as possible with its plugin event model, so you can extend it with image generation, model selectors, and other custom logic. See the plugin docs.


๐Ÿ“บ Video Tutorials (Chinese)


  • CowAgent โ€” our other project, upgraded to 2.0 Agent capabilities: task planning, long-term memory, knowledge base, skills, MCP, and more, also covering channels like WeChat, Feishu, DingTalk, Enterprise WeChat, QQ, Telegram, Slack, and Discord. Give it a try if you want a more complete AI assistant
  • Cow Skill Hub โ€” an open skill marketplace for AI Agents, works with CowAgent, OpenClaw, Claude Code, and more
  • AgentMesh โ€” an open-source multi-agent framework that solves complex problems through team collaboration

โš ๏ธ Disclaimer

  1. This project is under the MIT License and is meant for technical research and learning. Please follow the laws and regulations in your area; you are responsible for any consequences of using this project.
  2. ERNIE Bot, New Bing, and Bard are accessed through their web versions and may stop working when the official policies change โ€” they're for learning only. For production use, prefer the official APIs or LinkAI.
Related repositories
NousResearch/hermes-agent

The agent that grows with you

PythonPyPIMIT Licenseaiai-agent
hermes-agent.nousresearch.com
217.9k41.1k
f/prompts.chat

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source โ€” self-host for your organization with complete privacy.

HTMLOtherchatgptai
prompts.chat
166.1k21.5k
langflow-ai/langflow

Langflow is a powerful tool for building and deploying AI-powered agents and workflows.

PythonPyPIMIT Licensereact-flowchatgpt
langflow.org
152.1k9.6k
langchain-ai/langchain

The agent engineering platform.

PythonPyPIMIT Licenseaianthropic
docs.langchain.com/langchain/
142.2k23.6k
f/awesome-chatgpt-prompts

This repo includes ChatGPT prompt curation to use ChatGPT and other LLM tools better.

HTMLCreative Commons Zero v1.0 Universalchatbotchatgpt
prompts.chat
121.3k16.3k
microsoft/generative-ai-for-beginners

21 Lessons, Get Started Building with Generative AI

Jupyter NotebookMIT Licenseaichatgpt
113.3k60.8k
ChatGPTNextWeb/NextChat

โœจ Light and Fast AI Assistant. Support: Web | iOS | MacOS | Android | Linux | Windows

TypeScriptnpmMIT Licensechatgptnextjs
nextchat.club
88.5k59.4k
OpenHands/OpenHands

๐Ÿ™Œ OpenHands: AI-Driven Development

PythonPyPIOtheragentartificial-intelligence
openhands.dev
81.4k10.4k
lobehub/lobehub

๐Ÿคฏ LobeHub is your Chief Agent Operator, organizing your agents into 7ร—24 operations by hiring, scheduling, and reporting on your entire AI team.

TypeScriptnpmOtherchatgptopenai
lobehub.com
80.6k15.7k
ChatGPTNextWeb/ChatGPT-Next-Web

A cross-platform ChatGPT/Gemini UI (Web / PWA / Linux / Win / MacOS). ไธ€้”ฎๆ‹ฅๆœ‰ไฝ ่‡ชๅทฑ็š„่ทจๅนณๅฐ ChatGPT/Gemini/Claude LLM ๅบ”็”จใ€‚

TypeScriptnpmchatgptnextjs
nextchat.dev/chat
78.5k60k
dair-ai/Prompt-Engineering-Guide

๐Ÿ™ Guides, papers, lessons, notebooks and resources for prompt engineering, context engineering, RAG, and AI Agents.

MDXMIT Licensedeep-learningprompt-engineering
promptingguide.ai
76.8k8.4k
openai/openai-cookbook

Examples and guides for using the OpenAI API

Jupyter NotebookMIT Licenseopenaichatgpt
cookbook.openai.com
74.8k12.7k