Esempio n. 1
0
    def init_handlers(self) -> List[HandlerMetadata]:

        handlers_list = [
            HandlerMetadata(
                cls=handlers.MessageHandler,
                callback=self.start_bot_handler,
                filters=filters.command(['start']),
                group=0,
            ),
            HandlerMetadata(
                cls=handlers.MessageHandler,
                callback=self.base_commands_handler,
                filters=filters.command(['lang', 'help', 'home']),
                group=0,
            ),
            HandlerMetadata(
                cls=handlers.MessageHandler,
                callback=self.downloads_handler,
                filters=filters.private & filters.regex("^/dl_[a-zA-Z0-9_]+$"),
                group=0,
            ),
            HandlerMetadata(
                cls=handlers.MessageHandler,
                callback=self.search_query_handler,
                filters=filters.private & filters.text & ~filters.bot
                & ~filters.via_bot & ~filters.media,
                group=0,
            ),
            HandlerMetadata(
                cls=handlers.MessageHandler,
                callback=self.bot_message_handler,
                group=0,
            ),
        ]
        return handlers_list
Esempio n. 2
0
 def init_handlers(self) -> List[HandlerMetadata]:
     return [
         HandlerMetadata(
             cls=handlers.InlineQueryHandler,
             callback=self.custom_commands_handler,
             filters=filters.regex("^#(?P<command>[a-zA-Z0-9_]+)(\s(?P<arg1>[a-zA-Z0-9_]+))?"),
             group=0,
         ),
         HandlerMetadata(
             cls=handlers.InlineQueryHandler,
             callback=self.on_inline_query,
             group=0
         )
     ]
Esempio n. 3
0
 def init_handlers(self) -> List[HandlerMetadata]:
     return [
         HandlerMetadata(
             cls=handlers.CallbackQueryHandler,
             callback=self.on_callback_query,
         )
     ]
 def init_handlers(self) -> List[HandlerMetadata]:
     return [
         HandlerMetadata(
             cls=handlers.MessageHandler,
             callback=self.user_message_handler,
         )
     ]
 def init_handlers(self) -> List['HandlerMetadata']:
     return [
         HandlerMetadata(cls=handlers.DeletedMessagesHandler,
                         callback=self.deleted_messages_handler,
                         has_filter=False,
                         group=2)
     ]
 def init_handlers(self) -> List[HandlerMetadata]:
     return [
         HandlerMetadata(
             cls=handlers.ChatMemberUpdatedHandler,
             callback=self.chat_member_update_handler,
             group=3
         )
     ]
 def init_handlers(self) -> List[HandlerMetadata]:
     return [
         HandlerMetadata(
             cls=handlers.ChosenInlineResultHandler,
             callback=self.on_chosen_inline_query,
             group=0,
         )
     ]
 def init_handlers(self) -> List[HandlerMetadata]:
     return [
         HandlerMetadata(
             cls=handlers.RawUpdateHandler,
             callback=self.raw_update_handler,
             has_filter=False,
             group=1,
         )
     ]