Allow multiple chosen inline result handler
CrsiX opened this issue · comments
The chosen inline result handler (ChosenInlineResultHandler
) does not support any form of filter or pattern. Those are necessary to set up more than one handler. Because otherwise the first handler would just catch all incoming updates and all subsequent handlers would have nothing to do.
We might want to add the functionality of pattern matching and handler switching to the base class BaseInlineResult
in __call__
.
This feature is necessary to allow #7 in combination with #33 in its current (b64a913) implementation. At the moment, only communisms can be forwarded. If we want to allow this for payment requests or any other form of inline interaction, we need to determine which handler "applies" for a given inline query.
In order to make this work, the result_id
of the ChosenInlineResult
must reflect the origin of the inline query (besides the currently stored data).
By using the FilteredChosenInlineResultHandler
handler, which is defined here, you can use it similar to the InlineQueryHandler
class (as it's supporting the pattern
parameter).
Note that you must use the correct format for the result_id
to make this work. By convention, this result ID should start with the command name.