Exemple #1
0
 def decorator(func: typing.Callable[..., typing.Any]):
     record = self.router.registrar.new()
     record.with_filters(*filters)
     if self.bot_type is BotType.BOT:
         record.filters.append(EventTypeFilter(BotEventType.MESSAGE_NEW))
     else:
         record.filters.append(EventTypeFilter(EventId.MESSAGE_EVENT.value))
     record.handle(SimpleBotCallback(func, self.bot_type))
     self.router.registrar.register(record.ready())
     return func
Exemple #2
0
 def decorator(func: typing.Callable[..., typing.Any]):
     record = self.router.registrar.new()
     record.with_filters(*filters)
     record.handle(SimpleBotCallback(func, self.bot_type))
     self.router.registrar.register(record.ready())
     return func