1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
|
//! This is telegram bot to fetch RSS/ATOM feeds and post results on public
//! channels
#![warn(missing_docs)]
mod command;
mod core;
mod sql;
use stacked_errors::{
Result,
StackableErr,
};
use tgbot::handler::LongPoll;
#[async_std::main]
async fn main() -> Result<()> {
let settings = config::Config::builder()
.set_default("api_gateway", "https://api.telegram.org").stack()?
.add_source(config::File::with_name("rsstg"))
.build()
.stack()?;
let core = core::Core::new(settings).await.stack()?;
|
>
>
>
>
>
|
>
>
>
|
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
|
//! This is telegram bot to fetch RSS/ATOM feeds and post results on public
//! channels
#![warn(missing_docs)]
mod command;
mod core;
mod sql;
use async_compat::Compat;
use stacked_errors::{
Result,
StackableErr,
};
use tgbot::handler::LongPoll;
fn main () -> Result<()> {
smol::future::block_on(Compat::new(async {
async_main().await.unwrap();
}));
Ok(())
}
async fn async_main () -> Result<()> {
let settings = config::Config::builder()
.set_default("api_gateway", "https://api.telegram.org").stack()?
.add_source(config::File::with_name("rsstg"))
.build()
.stack()?;
let core = core::Core::new(settings).await.stack()?;
|