diff --git a/scripts/push_image.sh b/scripts/push_image.sh new file mode 100755 index 0000000..15445a1 --- /dev/null +++ b/scripts/push_image.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) + +version="$("$SCRIPT_DIR/get_version.sh")" + +docker push jmarcelomb/telebot:latest +docker push "jmarcelomb/telebot:$version" diff --git a/scripts/run_telebot.sh b/scripts/run_telebot.sh new file mode 100755 index 0000000..7cb1249 --- /dev/null +++ b/scripts/run_telebot.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +docker stop running_telebot +docker rm running_telebot +docker run --name running_telebot --env-file .env -d jmarcelomb/telebot:latest diff --git a/src/main.rs b/src/main.rs index b331844..aa9ab2d 100644 --- a/src/main.rs +++ b/src/main.rs @@ -102,14 +102,14 @@ async fn start(bot: Bot, dialogue: MyDialogue, msg: Message) -> HandlerResult { } async fn help(bot: Bot, msg: Message) -> HandlerResult { - let version = env!("CARGO_PKG_VERSION"); - bot.send_message(msg.chat.id, format!("Current version is: {} 🏷️", version)) + bot.send_message(msg.chat.id, Command::descriptions().to_string()) .await?; Ok(()) } async fn version(bot: Bot, msg: Message) -> HandlerResult { - bot.send_message(msg.chat.id, Command::descriptions().to_string()) + let version = env!("CARGO_PKG_VERSION"); + bot.send_message(msg.chat.id, format!("Current version is: {} 🏷️", version)) .await?; Ok(()) } @@ -175,7 +175,7 @@ async fn milk_price_command(bot: Bot, msg: Message) -> HandlerResult { match milk_price { Some(price) => { - bot.send_message(msg.chat.id, format!("Current milk price is '{}' €", price)) + bot.send_message(msg.chat.id, format!("Current milk price is: {} €", price)) .await?; Ok(()) }