adjust to submodules

This commit is contained in:
2023-02-26 19:05:46 +03:00
parent d83af3e6cd
commit a657174b56
4 changed files with 9 additions and 1538 deletions

View File

@ -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 }