From b1a9e5fa463ac877b2f32e927366155e82b8b7d5 Mon Sep 17 00:00:00 2001 From: Remy Moll Date: Thu, 12 Oct 2023 12:19:35 +0200 Subject: [PATCH] add version in status command --- .drone.yml | 5 ++++- bot/commands/status.py | 5 +++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.drone.yml b/.drone.yml index d5fae5b..001db43 100644 --- a/.drone.yml +++ b/.drone.yml @@ -16,7 +16,10 @@ steps: from_secret: docker_pw repo: mollre/journal-bot - tags: 1.0.${DRONE_BUILD_NUMBER} + tags: + - 1.0.${DRONE_BUILD_NUMBER} + - latest + build_args: "BOT_VERSION=1.0.${DRONE_BUILD_NUMBER}" trigger: diff --git a/bot/commands/status.py b/bot/commands/status.py index 5f003b9..67dfaa6 100644 --- a/bot/commands/status.py +++ b/bot/commands/status.py @@ -4,7 +4,7 @@ import socket from telegram.ext import ConversationHandler, CommandHandler, CallbackQueryHandler from telegram import InlineKeyboardButton, InlineKeyboardMarkup from telegram.constants import ParseMode - +import os FIRST = 1 @@ -37,7 +37,7 @@ class StatusHandler(BaseHandler): reply_markup = InlineKeyboardMarkup(keyboard) delta = str(datetime.datetime.now() - self.start_time) - message = "BeebBop, this is Norbit\n" + message = "BeebBop, this is Norbit...\n" try: ip = httpx.get('https://api.ipify.org').text @@ -50,6 +50,7 @@ class StatusHandler(BaseHandler): local_ips = "not fetchable" message += "Status: Running 🟢\n" + message += f"Version: `{os.getenv('BOT_VERSION', 'dev')}`\n" message += f"Uptime: `{delta[:delta.rfind('.')]}`\n" message += f"IP \(public\): `{ip}`\n" message += f"IP \(private\): `{local_ips}`\n"