Skip to content

Conversation

Copy link

Copilot AI commented Dec 29, 2025

The repository contained type definitions for Bot API 7.x+ features (message reactions, business accounts, chat boosts) but lacked event handling infrastructure. Bots could receive these updates but had no way to process them.

Changes

Event Handlers Added

  • onMessageReaction() / onMessageReactionCount() - Track user reactions to messages
  • onBusinessConnection() / onBusinessMessage() / onEditedBusinessMessage() / onDeletedBusinessMessages() - Handle Telegram Business account integration
  • onChatBoost() / onRemovedChatBoost() - Monitor premium chat boost events

Implementation

  • Added listener typedefs and registration methods to EventBroadcaster
  • Wired up broadcast calls in EventHandler::handleUpdate()
  • Updated README to document supported features

Usage

bot.getEvents().onMessageReaction([](MessageReactionUpdated::Ptr reaction) {
    // Handle reaction on message
});

bot.getEvents().onBusinessMessage([](Message::Ptr msg) {
    // Process message from business account
});

bot.getEvents().onChatBoost([](ChatBoostUpdated::Ptr boost) {
    // Track chat boosts
});

All changes follow existing patterns. No breaking changes to public API.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • api.telegram.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
  • core.telegram.org
    • Triggering command: /usr/bin/curl curl -s REDACTED (dns block)
    • Triggering command: /usr/bin/wget wget -qO- REDACTED (dns block)
    • Triggering command: `/usr/bin/python3 python3 -c
      import urllib.request
      import re

try:
response = urllib.request.urlopen('REDACTED')
html = response.read().decode('utf-8')
matches = re.findall(r'Bot API (\d+.\d+)', html)
if matches:
print('La` (dns block)

  • esm.ubuntu.com
    • Triggering command: /usr/lib/apt/methods/https /usr/lib/apt/methods/https (dns block)
  • https://api.github.com/repos/tdlib/telegram-bot-api/releases/latest
    • Triggering command: /usr/bin/curl curl -s REDACTED (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Original prompt

Update telegram bot api to latest available


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 3 commits December 29, 2025 01:12
Implement event handling for message reactions (MessageReactionUpdated and MessageReactionCountUpdated). These types were already defined in the codebase but event handlers were not wired up. This adds support for Bot API features related to message reactions.

Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Implement event handling for business features (BusinessConnection, business messages, deleted business messages) and chat boost features (ChatBoostUpdated, ChatBoostRemoved). These types were already in the codebase but event handlers were not wired up. This adds support for Bot API 7.x business and boost features.

Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Document recently added event handlers for message reactions, business account integration, and chat boosts. Clarify current Bot API version support and known limitations.

Co-authored-by: Royna2544 <69458352+Royna2544@users.noreply.github.com>
Copilot AI changed the title [WIP] Update Telegram bot API to latest available version Add event handlers for message reactions, business accounts, and chat boosts Dec 29, 2025
Copilot AI requested a review from Royna2544 December 29, 2025 01:20
@Royna2544 Royna2544 marked this pull request as ready for review December 29, 2025 03:18
@Royna2544 Royna2544 merged commit 62c0d51 into master Dec 29, 2025
1 check passed
@Royna2544 Royna2544 deleted the copilot/update-telegram-bot-api-again branch December 29, 2025 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants