bytesnake / telebot

Write Telegram bots in Rust with Tokio and Futures
Other
212 stars 33 forks source link

panic on forwarded channel posts #5

Closed ratijas closed 7 years ago

ratijas commented 7 years ago
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Syntax(MissingField("first_name"), 1, 226)' …

i guess it's the problem of code auto-generation in telebot-derive crate.

UPD: i think i found the root of the error. it's line 61 of objects.rs: pub forward_from_chat: Option<User>, it has to be Option<Chat> instead.

bytesnake commented 7 years ago

Thanks, this is indeed wrong. It would be awesome if Telegram could export their protocol to JSON or something, then we could autogenerate the fields.

ratijas commented 7 years ago

seems like tl schema is all json we could have :(

https://core.telegram.org/schema/json