2021-04-09 10:17:38 +02:00
|
|
|
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')
|
2022-09-02 17:44:56 +02:00
|
|
|
await event.reply(t('LEGACY', request_context.chat.language))
|
2021-04-09 10:17:38 +02:00
|
|
|
|
|
|
|
|
|
|
|
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')
|
2022-09-02 17:44:56 +02:00
|
|
|
return await event.answer(t('LEGACY', request_context.chat.language))
|