|
@@ -21,7 +21,7 @@ from actions import (
|
|
|
add_or_update_birthday,
|
|
|
get_birthdays
|
|
|
)
|
|
|
-from utils import WORDS_TABLE, make_temporary_filename, parse_kind, get_link_to_user, get_word_kind
|
|
|
+from utils import WORDS_TABLE, make_temporary_filename, parse_kind, get_user_name, get_word_kind
|
|
|
|
|
|
class Handler:
|
|
|
def __init__(self, handler, is_restricted=False):
|
|
@@ -244,13 +244,12 @@ async def bday_handler(bot, event, command):
|
|
|
age = (birthday_date - birthday.date).days // 365
|
|
|
age_now = age - 1
|
|
|
|
|
|
- birthdays_list += '- '
|
|
|
- birthdays_list += get_link_to_user(await bot.get_entity(birthday.user_id))
|
|
|
- birthdays_list += ': '
|
|
|
+ birthdays_list += get_user_name(await bot.get_entity(birthday.user_id))
|
|
|
+ birthdays_list += ' — '
|
|
|
birthdays_list += birthday.date.strftime('%d.%m.%Y')
|
|
|
birthdays_list += f' (через {delta.days} {WORDS_TABLE["день"][get_word_kind(delta.days)]} исполнится {age} {WORDS_TABLE["год"][get_word_kind(age)]}; сейчас {age_now} {WORDS_TABLE["год"][get_word_kind(age_now)]})\n'
|
|
|
|
|
|
- await event.reply(f'Дни рождения:\n{birthdays_list}')
|
|
|
+ await event.reply(f'Дни рождения:\n\n{birthdays_list}')
|
|
|
|
|
|
COMMANDS = {
|
|
|
'newadmin': Handler(newadmin_handler, is_restricted=True),
|