async def subscription_handler(event):
    """List your current subscriptions"""
    if not await subscription_allowed(event):
        return
    locale = DATABASE.get_locale(event.chat_id)
    subscriptions = DATABASE.get_chat_subscriptions(event.chat_id)
    await event.reply(await subscriptions_message(subscriptions, locale))
    raise events.StopPropagation
Пример #2
0
async def subscriptions_help(event):
    """subscriptions settings callback handler"""
    locale = DATABASE.get_locale(event.chat_id)
    subscriptions = DATABASE.get_chat_subscriptions(event.chat_id)
    try:
        await event.edit(await subscriptions_message(subscriptions, locale), buttons=[
            [Button.inline(LOCALIZE.get_text(locale, "Back"), data="settings")],
        ])
    except (MessageNotModifiedError, ChannelPrivateError, ChatWriteForbiddenError):
        pass