adjust to submodules
This commit is contained in:
12
src/main.rs
12
src/main.rs
@ -1,10 +1,9 @@
|
||||
use env_logger;
|
||||
use envconfig::Envconfig;
|
||||
use log::{debug, info, warn};
|
||||
use teloxide::{prelude::*, utils::command::BotCommand};
|
||||
|
||||
const VERSION: &'static str = env!("GIT_REVISION");
|
||||
const BRANCH: &'static str = env!("GIT_BRANCH");
|
||||
const VERSION: &str = env!("GIT_REVISION");
|
||||
const BRANCH: &str = env!("GIT_BRANCH");
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() {
|
||||
@ -45,10 +44,9 @@ async fn run() {
|
||||
teloxide::commands_repl(bot, bot_name, move |cx, command| {
|
||||
let climate = settings.climate_dsn.clone();
|
||||
let cmd: String = settings.hosttemp_cmd.clone();
|
||||
let cmd: Vec<&str> = cmd.split(" ").collect();
|
||||
let console_cmd = cmd.get(0).expect("getting console command").to_string();
|
||||
let arg: String = cmd.get(1).unwrap_or_else(|| &"").to_string();
|
||||
// let startup = std::sync::Arc::from(*startup);
|
||||
let cmd: Vec<&str> = cmd.split(' ').collect();
|
||||
let console_cmd = cmd.first().expect("getting console command").to_string();
|
||||
let arg: String = cmd.get(1).unwrap_or(&"").to_string();
|
||||
let startup = *startup;
|
||||
|
||||
async move { handler(cx, command, climate, console_cmd, arg, startup).await }
|
||||
|
||||
Reference in New Issue
Block a user