2021-04-09 10:17:38 +02:00
|
|
|
from library.telegram.base import RequestContext
|
|
|
|
from nexus.translations import t
|
|
|
|
from telethon import (
|
|
|
|
Button,
|
|
|
|
events,
|
|
|
|
)
|
|
|
|
|
|
|
|
from .base import BaseHandler
|
|
|
|
|
|
|
|
|
|
|
|
class HelpHandler(BaseHandler):
|
|
|
|
filter = events.NewMessage(incoming=True, pattern='^/help(@[A-Za-z0-9_]+)?$')
|
|
|
|
is_group_handler = True
|
|
|
|
|
|
|
|
async def handler(self, event: events.ChatAction, request_context: RequestContext):
|
|
|
|
request_context.statbox(action='show', mode='help')
|
|
|
|
if event.is_group or event.is_channel:
|
2022-09-02 17:44:56 +02:00
|
|
|
await event.reply(t('HELP_FOR_GROUPS', request_context.chat.language), buttons=Button.clear())
|
2021-04-09 10:17:38 +02:00
|
|
|
else:
|
2022-09-02 17:44:56 +02:00
|
|
|
await event.reply(t('HELP', request_context.chat.language), buttons=Button.clear())
|