Пост #268541

     
сохранен 04.03.2023 17:43
  • Редактировать пост
  • Печать
  • Скачать
  • Сравнить с постом
    #  
  • Нумерация строк
  • Подсветка синтаксиса  
Текст поста
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
    async fn main() -> Result<(), Box<dyn Error>> {
        pretty_env_logger::init();
        log::info!("Starting FSA Subscriptions bot (version 0ρ0103)");
    
        let mut bot = Bot::from_env();
    
        let handler = dptree::entry()
            .branch(Update::filter_message().endpoint(message_handler))
            .branch(Update::filter_callback_query().endpoint(callback_handler))
            .branch(Update::filter_inline_query().endpoint(inline_query_handler));
        
        thread::spawn(move || pg_listen__expire_soon(&bot));
        thread::spawn(move || pg_listen__expired());
        thread::spawn(move || pg_listen__replenishment());
        
        Dispatcher::builder(&bot, handler).enable_ctrlc_handler().build().dispatch().await;

        Ok(())
    }
Добавить комментарий
Автор