Closed incker closed 4 years ago
Hi! You can write your own wrapper for methods: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=dffd072e8950417f3fafe10c415c69ad
Оh, thank you!!
That makes sense. Didn't know about #[serde(flatten)]
macro
Maybe once you will have want add MethodWrapper
that will work something like
let method_wrapper: MethodWrapper<SendMessage> = SendMessage::new(chat_id, "My Webhook answer...").as_webhook_answer();
But for now flatten macro solution suits me great!) Again thank you
Hello!
I have found out that webhook can reply with message. See link
I have test it, and it is true. Here is a primitive webhook WORKING example
So, the question is, how can I build an answer using
SendMessage
struct? something like this:instead of hand-write
json!({ })
. I have noticed thatSendMessage
struct have no "method" field andRequestBuilder
seems like something other.If there will be a working example how to handle if - will be ideal Forward thank you for your answer