python-telegram-bot/python-telegram-bot · warning · Warning
Updates handled by {handler.__class__.__name__} only have in
Error message
Updates handled by {handler.__class__.__name__} only have information about the user, so this handler won't ever be triggered if `per_chat=True`.{per_faq_link} What it means
Handlers whose updates only identify a user (InlineQueryHandler, ChosenInlineResultHandler, PreCheckoutQueryHandler, PollAnswerHandler) can never satisfy per_chat=True tracking, so they will never trigger inside such a ConversationHandler.
Source
Thrown at src/telegram/ext/_handlers/conversationhandler.py:399
elif isinstance(handler, PollHandler):
warn(
"PollHandler will never trigger in a conversation since it has no information "
"about the chat or the user who voted in it. Do you mean the "
"`PollAnswerHandler`?",
stacklevel=2,
)
elif self.per_chat and (
isinstance(
handler,
ShippingQueryHandler
| InlineQueryHandler
| ChosenInlineResultHandler
| PreCheckoutQueryHandler
| PollAnswerHandler,
)
):
warn(
f"Updates handled by {handler.__class__.__name__} only have information about "
"the user, so this handler won't ever be triggered if `per_chat=True`."
f"{per_faq_link}",
stacklevel=2,
)
elif self.per_message and not isinstance(handler, CallbackQueryHandler):
warn(
"If 'per_message=True', all entry points, state handlers, and fallbacks"
" must be 'CallbackQueryHandler', since no other handlers "
f"have a message context.{per_faq_link}",
stacklevel=2,
)
elif not self.per_message and isinstance(handler, CallbackQueryHandler):
warn(
"If 'per_message=False', 'CallbackQueryHandler' will not be "
f"tracked for every message.{per_faq_link}",
stacklevel=2,View on GitHub (pinned to d3b69d2e9f)
Solutions
- Set per_chat=False (and rely on per_user/per_message) for user-only update types
- Remove those handlers from the conversation and handle them at Application level
Example fix
# before
ConversationHandler(..., per_chat=True, states={0: [InlineQueryHandler(cb)]})
# after
ConversationHandler(..., per_chat=False, per_user=True, states={0: [InlineQueryHandler(cb)]}) Defensive patterns
Strategy: validation
Validate before calling
user_only = (InlineQueryHandler, ChosenInlineResultHandler, PreCheckoutQueryHandler, PollAnswerHandler)
if ch.per_chat and any(isinstance(h, user_only) for h in ch.states.get(0, [])):
ch.per_chat = False # or remove handlers Prevention
- Set per_chat=False for inline/payment/poll-answer conversations
When it happens
Trigger: ConversationHandler(per_chat=True, ...) containing an InlineQueryHandler/ChosenInlineResultHandler/PreCheckoutQueryHandler/PollAnswerHandler.
Common situations: Inline-mode or payment conversations configured with per_chat=True out of habit.
Related errors
- If 'per_message=True' is used, 'per_chat=True' should also b
- `current_offset` and `next_offset` are mutually exclusive!
- A persistent `ConversationHandler` was passed to `add_handle
- The `ConversationHandler` only handles updates of type `tele
- The `ConversationHandler` only handles updates of type `tele
AI-assisted analysis of python-telegram-bot/python-telegram-bot@d3b69d2e9f (2026-08-28).
Data as JSON: /api/errors/866fe42643883a4d.
Report an issue: GitHub.