diff options
author | Mikhail Kirillov <w96k@runbox.com> | 2024-10-10 06:20:52 +0400 |
---|---|---|
committer | Mikhail Kirillov <w96k@runbox.com> | 2024-10-10 06:20:52 +0400 |
commit | 23bddf358dc615d18ed4470f33f383f1eac9ac63 (patch) | |
tree | 9d9ac4e9aa31c237b9a7776abc27dcd597d6d4e6 /commands/meta.py | |
parent | 8d2d5acde9d4d7d44d93c386e541692f4e45a271 (diff) |
Task #10. /announce command
Diffstat (limited to 'commands/meta.py')
-rw-r--r-- | commands/meta.py | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/commands/meta.py b/commands/meta.py index c98e770..5a61a84 100644 --- a/commands/meta.py +++ b/commands/meta.py @@ -11,22 +11,26 @@ from telegram import Update from telegram.ext import ContextTypes +from subprocess import check_output +from strings import ABOUT -async def about(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: - await update.message.reply_text(''' -Version InDev -python-cinema-club-bot is a bot for Telegram specialized for managing cinema club activities. This software is released as Public Domain using CC0 license. +VERSION="0.1" + -Project information: http://57.129.46.169/trac/wiki/python-cinema-club-bot -Source code: http://57.129.46.169/cgit/python-cinema-club-bot/ +def _get_commit_hash() -> str: + return check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip() -Contributed in 2024 by Mikhail Kirillov (~w96k) <w96k@runbox.com> -To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. +def _get_commit_short_hash() -> str: + return check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip() -You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see: -<http://creativecommons.org/publicdomain/zero/1.0/> - ''') +async def about(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None: + await update.message.reply_text( + ABOUT.format( + version=VERSION, + commit=_get_commit_short_hash(), + ) + ) |