# ChatGPT-Telegram-Bot **Repository Path**: xyhcodefilter/chat-gpt-telegram-bot ## Basic Information - **Project Name**: ChatGPT-Telegram-Bot - **Description**: telegram 机器人使用ChatGPT - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: main - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 1 - **Created**: 2023-03-10 - **Last Updated**: 2024-05-10 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # ChatGPT-Telegram-Bot #### 介绍 telegram 机器人使用ChatGPT #### 示例 问答 ![img.png](img/t1.png) 图片 ![img.png](img/t2.png) #### 使用 > 把变量`openai.api_key` 和 `telegram_token` 以及`help`方法中的邮箱替换为自己的内容 ##### 本地 如果是在本地跑的话,需要开启代理 ##### Replit 也可以使用`replit` 部署 ,但是可能会有限制,不要试图在国内的服务器跑,国内服务器连接不是`telegram` ![img.png](img/t3.png) #### 创建Telegram Bot 先给 [BotFather](https://t.me/BotFather) 发送指令 ```text /newbot ``` 发送机器人名字 > 上一步后回应: Alright, a new bot. How are we going to call it? Please choose a name for your bot. ```text 比如叫 AI 就发送AI ``` 给机器人起用户名 > 上一步回复:Good. Now let's choose a username for your bot. It must end in `bot`. Like this, for example: TetrisBot or tetris_bot. ```text 发送一个机器人用户名 必须以 _bot 结尾,如果有这个用户名了会告诉你重新发送 比如 chattest_bot ``` 返回token > 要保存`token` 跑项目的时候需要使用 在 `Use this token to access the HTTP API:`下面 ![img.png](img/t4.png) 给机器人添加头像 > 输入这个指令后 需要选择刚刚创建的机器人用户名 然后发送图片就可以 ```text /setdescription ``` 设置指令 > 发送这个指令后 同样需要选择自己机器人的用户名 点击 `edit bot` ```text /mybots ``` ![img.png](img/t5.png) 选择编辑指令 ![img.png](img/t6.png) 发送指令 > 如果需要更多可以类似这样添加 下面示例只针对本项目 ```text start - 开始使用AI picture - 随机图片 help - 滴博主 ```