Lines of
src/main.rs
from check-in 9c4f09193a
that are changed by the sequence of edits moving toward
check-in fabcca1eaf:
1: //! This is telegram bot to fetch RSS/ATOM feeds and post results on public
2: //! channels
3:
4: #![warn(missing_docs)]
5:
6: mod command;
7: mod core;
8: mod sql;
9: mod tg_bot;
10:
11: use async_compat::Compat;
12: use stacked_errors::{
13: Result,
14: StackableErr,
15: };
16: use tgbot::handler::LongPoll;
17:
18: fn main () -> Result<()> {
19: smol::block_on(Compat::new(async {
20: async_main().await.unwrap();
21: }));
22:
23: Ok(())
24: }
25:
26: async fn async_main () -> Result<()> {
27: let settings = config::Config::builder()
28: .set_default("api_gateway", "https://api.telegram.org").stack()?
29: .add_source(config::File::with_name("rsstg"))
30: .build()
31: .stack()?;
32:
33: let core = core::Core::new(settings).await.stack()?;
34:
35: LongPoll::new(core.tg.client.clone(), core).run().await;
36:
37: Ok(())
38: }