Handle both commands and messages #648
-
I would like to define a chain where:
I've been trying to do this with dptree for several hours 🤯, but to no avail. My last non-workable code (the dptree::entry()
.branch(Update::filter_my_chat_member().endpoint(updates::handle_my_chat_member))
.branch(
Update::filter_message()
.filter_command::<Cmd>()
.endpoint(cmd::handle),
)
.branch(Update::filter_message().endpoint(updates::handle_message)) I also tried this, but it clearly is incorrect because I see that all update kinds are logged as "allowed updates", and my code is still unreachable at runtime for this one: dptree::entry()
.branch(Update::filter_my_chat_member().endpoint(updates::handle_my_chat_member))
.branch(
Update::filter_message()
.branch(
dptree::entry()
.filter_command::<Cmd>()
.endpoint(cmd::handle),
)
.endpoint(updates::handle_message),
) How can I define it with |
Beta Was this translation helpful? Give feedback.
Answered by
WaffleLapkin
Jun 12, 2022
Replies: 1 comment 1 reply
-
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
WaffleLapkin
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I've tried your first code example and it just works for me?...
Full code