Timmy-web / Poe-Telegram-Chatbot

调用Poe官方API实现Telegram对话机器人,主要调用GPT-4和Claude-3-Opus模型。
167 stars 18 forks source link

Poe-Telegram-Chatbot

这是一个使用 Python 和 Telegram Bot API 构建的聊天机器人,它利用了 Poe API 提供的 AI 模型进行纯文字对话。(暂不支持上传图片,文件)

功能特点

安装与运行

前置要求

本地运行

  1. 克隆此仓库:

    git clone https://github.com/Timmy-web/Poe-Telegram-Chatbot.git
    cd Poe-Telegram-Chatbot
  2. 安装依赖:

    pip install -r requirements.txt
  3. 设置环境变量:

    export TELEGRAM_BOT_TOKEN="your_telegram_bot_token"
    export POE_API_KEY="your_poe_api_key"
  4. 运行 bot:

    python bot.py

Docker 运行

运行 Docker 容器:

docker run -d --name poebot \
  -e TELEGRAM_BOT_TOKEN="your_telegram_bot_token" \
  -e POE_API_KEY="your_poe_api_key" \
  ghcr.io/timmy-web/poe-bot

或者使用 docker-compose:

docker-compose up -d

注意将 your_telegram_bot_token 和 your_poe_api_key 替换为你自己的 Token 和 API 密钥。

使用方法

直接在聊天界面输入问题,机器人就会自动回复。