Skip to content

πŸš€ An AI-powered Telegram bot using DeepSeek AI for intelligent and context-aware responses. support multiple deepseek mode and interact with telegram bot.

License

Notifications You must be signed in to change notification settings

yincongcyincong/telegram-deepseek-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

group

telegram-group: https://t.me/+WtaMcDpaMOlhZTE1 , or you can have a try robot GWSbot.
every body have 3000 token to try this bot, please give me a star!

DeepSeek Telegram Bot

This repository provides a Telegram bot built with Golang that integrates with DeepSeek API to provide AI-powered responses. The bot supports streaming replies, making interactions feel more natural and dynamic.
δΈ­ζ–‡ζ–‡ζ‘£

πŸš€ Features

  • πŸ€– AI Responses: Uses DeepSeek API for chatbot replies.
  • ⏳ Streaming Output: Sends responses in real-time to improve user experience.
  • 🎯 Command Handling: Supports custom commands.
  • πŸ— Easy Deployment: Run locally or deploy to a cloud server.
  • 🎺 Support Voice: use voice to communicate with deepseek, see doc.

πŸ€– Usage Example

aa92b3c9580da6926a48fc1fc5c37c03 aa92b3c9580da6926a48fc1fc5c37c03

🎺 Voice Example

aa92b3c9580da6926a48fc1fc5c37c03

πŸ“Œ Requirements

πŸ“₯ Installation

  1. Clone the repository

    git clone https://github.com/yourusername/deepseek-telegram-bot.git
    cd deepseek-telegram-bot
  2. Install dependencies

     go mod tidy
  3. Set up environment variables

     export TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
     export DEEPSEEK_TOKEN="your_deepseek_api_key"

πŸš€ Usage

Run the bot locally:

 go run main.go -telegram_bot_token=telegram-bot-token -deepseek_token=deepseek-auth-token

Use docker

  docker pull jackyin0822/telegram-deepseek-bot:latest
  docker run -d -v /home/user/data:/app/data -e TELEGRAM_BOT_TOKEN="telegram-bot-token" -e DEEPSEEK_TOKEN="deepseek-auth-token" --name my-telegram-bot  jackyin0822/telegram-deepseek-bot:latest

βš™οΈ Configuration

You can configure the bot via environment variables:

Variable Name Description Default Value
TELEGRAM_BOT_TOKEN (required) Your Telegram bot token -
DEEPSEEK_TOKEN (required) DeepSeek Api Key / volcengine Api keydoc -
CUSTOM_URL custom deepseek url https://api.deepseek.com/
DEEPSEEK_TYPE deepseek/others(deepseek-r1-250120,doubao-1.5-pro-32k-250115,...) deepseek
VOLC_AK volcengine photo model ak doc -
VOLC_SK volcengine photo model sk doc -
DB_TYPE sqlite3 / mysql sqlite3
DB_CONF ./data/telegram_bot.db / root:admin@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local ./data/telegram_bot.db
ALLOWED_TELEGRAM_USER_IDS telegram user id, only these users can use bot, using "," splite. empty means all use can use it. 0 means all user is banned -
ALLOWED_TELEGRAM_GROUP_IDS telegram chat id, only these chat can use bot, using "," splite. empty means all group can use it. 0 means all group is banned -
DEEPSEEK_PROXY deepseek proxy -
TELEGRAM_PROXY telegram proxy -
LANG en / zh en
TOKEN_PER_USER The tokens that each user can use 10000
ADMIN_USER_IDS admin user, can use some admin commands -
NEED_AT_BOT is it necessary to trigger an at robot in the group false
MAX_USER_CHAT max existing chat per user 2
VIDEO_TOKEN volcengine Api keydoc -

CUSTOM_URL

If you are using a self-deployed DeepSeek, you can set CUSTOM_URL to route requests to your self-deployed DeepSeek.

DEEPSEEK_TYPE

deepseek: directly use deepseek service. but it's not very stable
others: see doc

DB_TYPE

support sqlite3 or mysql

DB_CONF

if DB_TYPE is sqlite3, give a file path, such as ./data/telegram_bot.db
if DB_TYPE is mysql, give a mysql link, such as root:admin@tcp(127.0.0.1:3306)/dbname?charset=utf8mb4&parseTime=True&loc=Local, database must be created.

LANG

choose a language for bot, English or Chinese.

other config

deepseek_conf
photo_conf
video_conf
audio_conf

Command

/clear

clear all of your communication record with deepseek. this record use for helping deepseek to understand the context.

/retry

retry last question.

/mode

chose deepseek mode, include chat, coder, reasoner
chat and coder means DeepSeek-V3, reasoner means DeepSeek-R1.
aa92b3c9580da6926a48fc1fc5c37c03

/balance

aa92b3c9580da6926a48fc1fc5c37c03

/state

calculate one user token usage.
aa92b3c9580da6926a48fc1fc5c37c03

/photo

using volcengine photo model create photo, deepseek don't support to create photo now. VOLC_AK and VOLC_SK is necessary.doc
aa92b3c9580da6926a48fc1fc5c37c03

/video

create video. DEEPSEEK_TOKEN must be volcengine Api key. deepseek don't support to create video now. doc
aa92b3c9580da6926a48fc1fc5c37c03

/chat

allows the bot to chat through /chat command in groups, without the bot being set as admin of the group. aa92b3c9580da6926a48fc1fc5c37c03

/help

aa92b3c9580da6926a48fc1fc5c37c03

Admin Command

/addtoken

add token for user.
aa92b3c9580da6926a48fc1fc5c37c03

Deployment

Deploy with Docker

  1. Build the Docker image

     docker build -t deepseek-telegram-bot .
  2. Run the container

      docker run -d -v /home/user/xxx/data:/app/data -e TELEGRAM_BOT_TOKEN="telegram-bot-token" -e DEEPSEEK_TOKEN="deepseek-auth-token" --name my-telegram-bot telegram-deepseek-bot 

Contributing

Feel free to submit issues and pull requests to improve this bot. πŸš€

License

MIT License Β© 2025 jack yin

Star History

Star History Chart

About

πŸš€ An AI-powered Telegram bot using DeepSeek AI for intelligent and context-aware responses. support multiple deepseek mode and interact with telegram bot.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published