Closed TheBestJohn closed 5 years ago
If you want to issue a single telegram after something is done, curl will probably be simpler to use: https://gist.github.com/krustnic/536224308a49dd93623d90e1ac4d6df8
Otherwise your application can execute the future either with a spawn
or by returning it from an arbitrary and_then
call.
Ah I see, this crate is more for handling the reactionary user interaction part of a telegram bot. Other commands need not be set in futures. I guess my understanding of the core issue was off. Thank you for your comments :)
Yeah my point was that it is unnecessary to pull in 150+ dependencies just to send a single Telegram message, it makes only sense if you have more complex application or are already using tokio
Well I am wanting the ability to set up a "administration" sort of interface that this is perfect for. I want to subscribe to several different processes, events, reminders etc. Sending the needed media/messages once they come in can be handled by different threads or something I suppose.
It would be useful to be able to send a message without a command needing to be registered. If I have some form of hardware or a build running I'd like to be able to do something like
bot.message(&saved_id, "Build is done").send()
I may just really be suffering from a lack of understanding of futures. Basically I want to be able to register a function into the bots execution queue from exterior functions.