Skip to content

Commit

Permalink
Adds push & run scripts. Fix help and version cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
jmarcelomb committed Jun 10, 2024
1 parent 1fe2415 commit f7a0c84
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 4 deletions.
8 changes: 8 additions & 0 deletions scripts/push_image.sh
Original file line number Diff line number Diff line change
@@ -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"
5 changes: 5 additions & 0 deletions scripts/run_telebot.sh
Original file line number Diff line number Diff line change
@@ -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
8 changes: 4 additions & 4 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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(())
}
Expand Down Expand Up @@ -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(())
}
Expand Down

0 comments on commit f7a0c84

Please sign in to comment.