Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ConversationHandler do not support per_message_thread_id conversations #4768

@RomanValov

Description

@RomanValov

What kind of feature are you missing? Where do you notice a shortcoming of PTB?

Hello,

I'm developing a bot based on python-telegram-bot which leverages topics (threads) in group chats. In particular I would like to use ConversationHandler to interact with a bot independently per message thread. But it looks that ConversationHandler supportsper_user andper_chat modes.

Currently it's possible to start conversation in one topic and continue in another.

Describe the solution you'd like

Additional property for ConversationHandler to support chat topics

Describe alternatives you've considered

There is alsoper_message mode available for ConversationHandler, but using it with the following code:

app.add_handler(ConversationHandler(entry_points=[CommandHandler('edit',self.edit_command)],states={self.EDIT: [MessageHandler(filters.TEXT&~filters.COMMAND,self.edit_command_done)],            },fallbacks=[CommandHandler('cancel',self.cancel_command)],per_message=True,        ))

makes ConversationHandler not working and cresults in a warning:

PTBUserWarning: If 'per_message=True', all entry points, state handlers, and fallbacks must be 'CallbackQueryHandler', since no other handlers have a message context. Read this FAQ entry to learn more about the per_* settings: https://github.com/python-telegram-bot/python-telegram-bot/wiki/Frequently-Asked-Questions#what-do-the-per_-settings-in-conversationhandler-do.  app.add_handler(ConversationHandler(

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp