Skip to content

fix callback_query_id type according to telegram bot api docs - #2636

Merged
Badiboy merged 1 commit into
eternnoir:masterfrom
smirnovhub:master
Oct 17, 2026
Merged

Badiboy merged 1 commit into
eternnoir:masterfrom
smirnovhub:master

Conversation

@smirnovhub

Copy link
Copy Markdown
Contributor

Fixes #2632

Description

Describe your tests

Tested the changes on my own Telegram bot that handles inline buttons and callback queries. Verified that passing call.id directly to bot.answer_callback_query() works correctly without any static type checker warnings or runtime issues.

Python version: 3.14
OS: Linux, Windows 10

Checklist:

  • I added/edited example on new feature/change (if exists)
  • My changes won't break backward compatibility
  • I made changes both for sync and async

@Badiboy
Badiboy requested a balanced review from Copilot October 17, 2026 12:45
@Badiboy

Badiboy commented Oct 17, 2026

Copy link
Copy Markdown
Collaborator

Looks true, thank you.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

Both interfaces consistently correct the type mismatch without runtime changes or unresolved findings.

No open issues 🎉

What changed in this PR

Fixes #2632 by aligning callback query identifier types with the Telegram Bot API.

Changes:

  • Changes callback_query_id from int to str in both bot interfaces.
  • Updates matching docstrings without changing runtime behavior.
File Description
telebot/​async_telebot.py Corrects the asynchronous method’s annotation and docstring.
telebot/​__init__.py Corrects the synchronous method’s annotation and docstring.

Review effort: Balanced

@Badiboy
Badiboy merged commit b30de98 into eternnoir:master Oct 17, 2026
6 checks passed
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.

answer_callback_query() and CallbackQuery id type mismatch

3 participants