Telegram bot for group chats (Python + OpenAI Assistants API)
Python
Assistants API by OpenAI
Telegram API
The bot's task is to be a participant in a Telegram group chat and respond to messages in which it is tagged or if the message starts with the word “bot”.
To reply to messages, the bot uses documents added to the assistant and prompts.
In the bot settings, there should be an option to specify the ID of one or several groups whose messages it processes. All messages from other groups are ignored.
The bot processes messages from any participant of a valid group.
Assume the role of Admin - messages from these people will be used for further training of the bot.
To start, the list of admins can be specified in the bot settings by indicating their chatid.
In the future, it is planned to develop an administrative part of the bot, which will include the role of superadmin, functionality for editing the list of groups, list of admins, adding files to the project, and viewing statistics. But for now, this will not be implemented.
Training mechanism.
The administrator can correct the bot's response if necessary. The administrator replies to the bot's message (which in turn was a reply to the user's question) and writes the correct answer, starting with the word “correction” or “fix” (or maybe a hashtag?).
Once a day, the bot downloads the group's message history, filters messages from administrators containing corrections (see above), and forms a logical chain of 3 messages: user question –> bot response –> administrator correction.
From these messages, it forms the text of the correction (format to be agreed upon) and appends it to the corrections file. All corrections are added to one file and sent to the assistant. Examples of file update implementation are provided by ChatGPT.
Commands
By the command /update from an administrator (or superadmin), an unscheduled process of updating corrections is triggered.
Client's review of cooperation with Yevhenii Meduha
Telegram bot for group chats (Python + OpenAI Assistants API)Thank you, Yevhenii, for the quickly and high-quality implemented project and prompt feedback!
-
471 5 0 Hello!
Interesting and complex project — I will gladly join its implementation!
I have experience working with Python, am well acquainted with the Telegram API, and actively work with OpenAI (including Assistants API). I have already implemented Telegram bots with message processing, chat ID filtering, basic access rights, and logic like “response to a tag or keyword.”
I would be happy to discuss the details — ready to start today!
-
93973 1266 1 10 Hello. I develop Telegram bots on Node.js or Python. Ready to cooperate
-
10130 117 0 Hello.
I develop bots for Telegram on NodeJS. Ready to take on. Write, we will discuss.
-
1872 9 0 Hello, Dmytro!
Ready to implement a Telegram bot with OpenAI Assistants API integration for group chats.
What I will implement:
Processing messages only from allowed groups (group_id from configuration)
Responses to messages that start with “bot” or @mentions
… OpenAI Assistants API: responses are generated based on added documents and prompts
Role system: admins are set via chat_id, their permissions are saved
Reaction to corrections like: correction ... or rectification ...
Daily collection of messages, forming pairs:
question ➝ answer ➝ correction → record in correction file
Support for /update command to manually update the assistant
Clean and extendable code in Python + aiogram 3
Separated logic: handlers / utils / config / OpenAI / roles
I will do the project carefully, with documentation and scalability options.
I would be happy to take on the implementation – contact me!
-
1900 45 1 4 Good evening)
Interesting task, OpenAI will be connected, maybe we will develop a web interface for managing the bot
Write, I will implement)
-
101 1 0 Very interesting project!
I would be glad to try something new
Previously, I created a bot that responded to group comments (but for some reason it didn't work for the client, it's hard to work when you're ignored for 18 hours)
If you're ready to try and respond quickly, please send me a private message)
-
593 15 0 Hello,
I have several ready-made bots with similar functionality, so it will take minimal time to create your bot.
-
1993 12 0 Good day
I have extensive experience in developing bots
I have already developed a similar bot
Write to me
-
1346 13 1 Hello!
Ready to work on your task in more detail, I have some questions and we can start the development.
Write to me privately, I would be glad to work together.
-
198 Hello.
I am ready to undertake the development of a Telegram bot in Python using the OpenAI Assistants API and Telegram API. I will implement message processing from specified groups, role support, a training mechanism through "edits," and an /update command for admins. I have experience with similar projects. Write to me if you need to clarify details.
-
427 1 0 Hello, Dmytro.
We specialize in personalized AI agents, mainly coding in Python.
Of course, Telegram API and OpenAI technologies are clear. We will create a bot with such functionality.
We can develop a clear architecture and complete the task.
It is necessary to properly prepare the technical assignment, please write to me privately and we will arrange a short dialogue to determine all important details.
Thank you!
Current freelance projects in the category Bot Development
Instagram chatbotIt is necessary to set up a chat bot on Instagram that will address new subscribers by name. A possible option for collaboration with setup in Telegram later. Bot Development ∙ 54 minutes back ∙ 15 proposals |
I am looking for a developer of AI agents and automation for business.
1000 USD
We are looking for agents for: — Sales and lead qualification — Marketing and content — Customer support — Analytics and reporting — Internal processes (HR, knowledge base) — Specialized niches (real estate, medicine, legal services) If you have experience or ready solutions —… AI & Machine Learning, Bot Development ∙ 6 hours 50 minutes back ∙ 28 proposals |
AI agent in Telegram for online store
451 USD
Task: creating an AI agent in Telegram for live communication with customers and processing orders in the online store on OpenCart. It is also necessary to implement customer notifications regarding order statuses, store operating hours, working conditions, delivery times, and… AI & Machine Learning, Bot Development ∙ 20 hours 26 minutes back ∙ 55 proposals |
Link UA Telegram botA Telegram bot needs to be developed that connects clients and performers of physical labor (movers, cleaning, repairs, laborers) across cities in Ukraine. Functionality: Two roles — client and performer. The client creates a request, selects a category, specifies the address… Bot Development ∙ 23 hours 4 minutes back ∙ 62 proposals |
Automation of creating advertising creatives.There is a solution in the form of Higgsfield AI + nodes that generate quite close to the idea based on the prompt, paired with almost frame-by-frame editing, everything works well, except for one thing, which is the censorship on the use of celebrity faces and such. An… AI & Machine Learning, Bot Development ∙ 1 day 9 hours back ∙ 8 proposals |