# ChatGPT Telegram Bot | To Get Answers Written In Python

**URL:** <https://onehack.st/t/chatgpt-telegram-bot-to-get-answers-written-in-python/282220>\
**Category:** Tools & Scripts\
**Tags:** tools, freebies, ai\
**Created:** [May 2, 2024, 8:24pm UTC](https://onehack.st/t/chatgpt-telegram-bot-to-get-answers-written-in-python/282220 "2024-05-02T20:24:00Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Aina](https://onehack.st/user_avatar/onehack.st/aina/32/167469_2.png) [@Aina](https://onehack.st/u/Aina)\
**Post date:** [May 2, 2024, 8:24pm UTC](https://onehack.st/t/chatgpt-telegram-bot-to-get-answers-written-in-python/282220/1 "2024-05-02T20:24:01Z")

</div>

![image](https://onehack.st/uploads/default/original/3X/7/4/741618d6fbaf6fb61f42b3453ce1bd9ae424d305.png)

🤖 A Telegram bot that integrates with OpenAI’s official ChatGPT APIs to provide answers, written in Python

A [Telegram bot](https://core.telegram.org/bots/api) that integrates with OpenAI’s _official_ [ChatGPT](https://openai.com/blog/chatgpt/), [DALL·E](https://openai.com/product/dall-e-2) and [Whisper](https://openai.com/research/whisper) APIs to provide answers. Ready to use with minimal configuration required.

 ![image](https://onehack.st/uploads/default/original/3X/7/4/741618d6fbaf6fb61f42b3453ce1bd9ae424d305.png)

### Plugins

 ![image](https://onehack.st/uploads/default/original/3X/8/4/848c434f2231cdc9acf2935db6670d97269c61c5.jpeg)

## Features

- Support markdown in answers
- Reset conversation with the `/reset` command
- Typing indicator while generating a response
- Access can be restricted by specifying a list of allowed users
- Docker and Proxy support
- Image generation using DALL·E via the `/image` command
- Transcribe audio and video messages using Whisper (may require [ffmpeg](https://ffmpeg.org/))
- Automatic conversation summary to avoid excessive token usage
- Track token usage per user - by [@AlexHTW](https://github.com/AlexHTW)
- Get personal token usage statistics via the `/stats` command - by [@AlexHTW](https://github.com/AlexHTW)
- User budgets and guest budgets - by [@AlexHTW](https://github.com/AlexHTW)
- Stream support
- GPT-4 support
  - If you have access to the GPT-4 API, simply change the `OPENAI_MODEL` parameter to `gpt-4`

- Localized bot language
  - Available languages 🇧🇷 🇨🇳 🇫🇮 🇩🇪 🇮🇩 🇮🇷 🇮🇹 🇲🇾 🇳🇱 🇵🇱 🇷🇺 🇸🇦 🇪🇸 🇹🇼 :türkiye: 🇺🇦 🇬🇧 🇺🇿 🇻🇳

- Improved inline queries support for group and private chats - by [@bugfloyd](https://github.com/bugfloyd)
  - To use this feature, enable inline queries for your bot in BotFather via the `/setinline` [command](https://core.telegram.org/bots/inline)

- Support _new models_ [announced on June 13, 2023](https://openai.com/blog/function-calling-and-other-api-updates)
- Support _functions_ (plugins) to extend the bot’s functionality with 3rd party services
  - Weather, Spotify, Web search, text-to-speech and more. See [here](https://github.com/n3d1117/chatgpt-telegram-bot#available-plugins) for a list of available plugins

- Support unofficial OpenAI-compatible APIs - by [@kristaller486](https://github.com/kristaller486)
- (NEW!) Support GPT-4 Turbo and DALL·E 3 [announced on November 6, 2023](https://openai.com/blog/new-models-and-developer-products-announced-at-devday) - by [@AlexHTW](https://github.com/AlexHTW)
- (NEW!) Text-to-speech support [announced on November 6, 2023](https://platform.openai.com/docs/guides/text-to-speech) - by [@gilcu3](https://github.com/gilcu3)
- (NEW!) Vision support [announced on November 6, 2023](https://platform.openai.com/docs/guides/vision) - by [@gilcu3](https://github.com/gilcu3)

## Prerequisites

- Python 3.9+
- A [Telegram bot](https://core.telegram.org/bots#6-botfather) and its token (see [tutorial](https://core.telegram.org/bots/tutorial#obtain-your-bot-token))
- An [OpenAI](https://openai.com/) account (see [configuration](https://github.com/n3d1117/chatgpt-telegram-bot#configuration) section)

## Continue at GitHub:

> **[GitHub - n3d1117/chatgpt-telegram-bot: 🤖 A Telegram bot that integrates with OpenAI's...](https://github.com/n3d1117/chatgpt-telegram-bot)**
>
> 🤖 A Telegram bot that integrates with OpenAI's official ChatGPT APIs to provide answers, written in Python
