Replies: 1 comment
-
You can make use of events in 4.x. We have Not found is triggered when someone sends a wrong command. Callable failed is triggered when a closure/callable command has required params that weren't sent by the user in addition to calling your callback (This is newly added as of May 10, 2023). Webhook failed is when there are any exceptions in general that caused a failure, so you can listen and take action accordingly. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
\Telegram\Bot\Commands\CommandHandler::processCommand()
has the following signature:as you can see, it returns
Update
instance. Thus, when you call it directly (as I do in SDK v3), I can't understand - is there a command processed a given Update or not (in my case, if not -- I need to send a fallback message). Also, there is no sense to return the same object you just passed, it's even not fluent-interface-friendly object.technically, we can change signature to this:
but it will be a BC change, this is why I raised this issue on SDK v4 repository.
Do you have any ideas on how to solve that without writing dirty hacks? (on both v3 and v4). I can even create a PR if there are no option ATM
Beta Was this translation helpful? Give feedback.
All reactions