Changeset 23bddf3 in python-cinema-club-bot for commands/meta.py


Ignore:
Timestamp:
Oct 10, 2024, 6:20:52 AM (5 weeks ago)
Author:
Mikhail Kirillov <w96k@…>
Branches:
master
Children:
1f94544
Parents:
8d2d5ac
Message:

Task #10. /announce command

File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands/meta.py

    r8d2d5ac r23bddf3  
    1212from telegram import Update
    1313from telegram.ext import ContextTypes
     14from subprocess import check_output
     15
     16from strings import ABOUT
     17
     18
     19VERSION="0.1"
     20
     21
     22def _get_commit_hash() -> str:
     23    return check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
     24
     25
     26def _get_commit_short_hash() -> str:
     27    return check_output(['git', 'rev-parse', '--short', 'HEAD']).decode('ascii').strip()
    1428
    1529
    1630async def about(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
    17     await update.message.reply_text('''
    18 Version InDev
    19 
    20 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.
    21 
    22 Project information: http://57.129.46.169/trac/wiki/python-cinema-club-bot
    23 Source code: http://57.129.46.169/cgit/python-cinema-club-bot/
    24 
    25 Contributed in 2024 by Mikhail Kirillov (~w96k) <w96k@runbox.com>
    26 
    27 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.
    28 
    29 You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see:
    30 <http://creativecommons.org/publicdomain/zero/1.0/>
    31 
    32     ''')
     31    await update.message.reply_text(
     32        ABOUT.format(
     33            version=VERSION,
     34            commit=_get_commit_short_hash(),
     35        )
     36    )
Note: See TracChangeset for help on using the changeset viewer.