百科.dev
全部条目AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
C

chatgpt-telegram

> AI 编程
开源

使用单个命令运行您自己的 GPTChat Telegram 机器人!

3.9K stars0 点赞0 次浏览
访问官网GitHub

工具介绍

使用单个命令运行您自己的 GPTChat Telegram 机器人!

ChatGPT-bot

Interact with ChatGPT

Go CLI to fuels a Telegram bot that lets you interact with ChatGPT, a large language model trained by OpenAI.

Installation

Download the file corresponding to your OS in the releases page.

  • chatgpt-telegram-Darwin-amd64: macOS (Intel)
  • chatgpt-telegram-Darwin-arm64: macOS (M1)
  • chatgpt-telegram-Linux-amd64: Linux
  • chatgpt-telegram-Linux-arm64: Linux (ARM)
  • chatgpt-telegram-Win-amd64: Windows

After you download the file, extract it into a folder and open the env.example file with a text editor and fill in your credentials.

  • TELEGRAM_TOKEN: Your Telegram Bot token
    • Follow this guide to create a bot and get the token.
  • TELEGRAM_ID (Optional): Your Telegram User ID
    • If you set this, only you will be able to interact with the bot.
    • To get your ID, message @userinfobot on Telegram.
    • Multiple IDs can be provided, separated by commas.
  • EDIT_WAIT_SECONDS (Optional): Amount of seconds to wait between edits
    • This is set to 1 by default, but you can increase if you start getting a lot of Too Many Requests errors.
  • Save the file, and rename it to .env.

Note Make sure you rename the file to exactly .env! The program won't work otherwise.

Finally, open the terminal in your computer (if you're on windows, look for PowerShell), navigate to the path you extracted the above file (you can use cd dirname to navigate to a directory, ask ChatGPT if you need more assistance ) and run ./chatgpt-telegram.

Running with Docker

If you're trying to run this on a server with an existing Docker setup, you might want to use our Docker image instead.

docker pull ghcr.io/m1guelpf/chatgpt-telegram

Here's how you'd set things up with docker-compose:

services:
  chatgpt-telegram:
    image: ghcr.io/m1guelpf/chatgpt-telegram
    container_name: chatgpt-telegram
    volumes:
      # your ".config" local folder must include a "chatgpt.json" file
      - .config/:/root/.config
    environment:
      - TELEGRAM_ID=
      - TELEGRAM_TOKEN=

Note The docker setup is optimized for the Browserless authentication mechanism, described below. Make sure you update the .config/chatgpt.json file in this repo with your session token before running.

Authentication

By default, the program will launch a browser for you to sign into your account, and close it once you're signed in. If this setup doesn't work for you (there are issues with the browser starting, you want to run this in a computer with no screen, etc.), you can manually extract your session from your browser instead.

To do this, first sign in to ChatGPT on your browser, then open the Developer Tools (right click anywhere in the page, then click "Inspect"), click on the Application tab and then on the Cookies section, and copy the value of the __Secure-next-auth.session-token cookie.

You will then have to create a config file in the following location depending on your OS (replace YOUR_USERNAME_HERE with your username:

  • ~/.config/chatgpt.json: Linux
  • C:\Users\YOUR_USERNAME_HERE\AppData\Roaming\chatgpt.json: Windows
  • /Users/YOUR_USERNAME_HERE/Library/Application Support/chatgpt.json: macOS

Note If you have already run the program, the file should exist but be empty. If it doesn't exist yet, you can either run the program or manually create it.

Finally, add your cookie to the file and save it. It should look like this: { "openaisession": "YOUR_COOKIE_HERE" }.

License

This repository is licensed under the MIT License.

GitHub Issues· 60 开放

在 GitHub 查看全部
  • #128

    Arjun

    更新于 2026年8月11日
  • #126

    قخق۸

    更新于 2025年8月20日
  • #123

    @MagicBuddyBot - ChatGPT for Telegram

    更新于 2024年2月11日
  • #121

    The bot program is deployed according to the readme, but I am in the telegram, and the bot does not respond

    更新于 2023年8月19日
  • #115

    Error: Couldn't get access token: failed to decode response: invalid character 'e' looking for beginning of value

    更新于 2023年7月18日
  • #88

    Error: Couldn't get access token: failed to decode response: invalid character '<' looking for beginning of value

    更新于 2023年6月29日
  • #119

    Gpt

    更新于 2023年6月18日
  • #31

    cant find .env file?

    更新于 2023年5月16日
  • #98

    Error: Couldn't get access token: failed to decode response: invalid character 'e' looking for beginning of value

    更新于 2023年5月8日
  • #118

    please help me

    更新于 2023年4月11日

核心特点

  • •chatgpt-telegram-Darwin-amd64: macOS (Intel)
  • •chatgpt-telegram-Darwin-arm64: macOS (M1)
  • •chatgpt-telegram-Linux-amd64: Linux
  • •chatgpt-telegram-Linux-arm64: Linux (ARM)
  • •chatgpt-telegram-Win-amd64: Windows
  • •TELEGRAM_TOKEN: Your Telegram Bot token
  • •Follow this guide to create a bot and get the token.
  • •TELEGRAM_ID (Optional): Your Telegram User ID
  • •If you set this, only you will be able to interact with the bot.
  • •To get your ID, message @userinfobot on Telegram.

> 标签

Gogpt-3gptchatopenaitelegram-bot

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.