mirror of
https://github.com/nexus-stc/hyperboria
synced 2024-11-18 17:29:26 +01:00
681817ceae
GitOrigin-RevId: 83514338be1d662518bab9fe5ab6eefef98f229f
29 lines
969 B
Python
29 lines
969 B
Python
from library.telegram.base import RequestContext
|
|
from nexus.translations import t
|
|
from telethon import events
|
|
|
|
from .base import (
|
|
BaseCallbackQueryHandler,
|
|
BaseHandler,
|
|
)
|
|
|
|
|
|
class LegacyHandler(BaseHandler):
|
|
filter = events.NewMessage(
|
|
incoming=True,
|
|
pattern='^/v_([A-Za-z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)$')
|
|
|
|
async def handler(self, event: events.ChatAction, request_context: RequestContext):
|
|
request_context.statbox(action='show', mode='legacy')
|
|
await event.reply(t('LEGACY', language=request_context.chat.language))
|
|
|
|
|
|
class LegacyCallbackHandler(BaseCallbackQueryHandler):
|
|
filter = events.CallbackQuery(
|
|
pattern='^/dl_([A-Za-z0-9]+)_([0-9]+)_([0-9]+)_([0-9]+)$'
|
|
)
|
|
|
|
async def handler(self, event: events.ChatAction, request_context: RequestContext):
|
|
request_context.statbox(action='show', mode='legacy')
|
|
return await event.answer(t('LEGACY', language=request_context.chat.language))
|