'on_member_update',
'handle_command',
'handle_help',
- 'eddn_message'
+ 'eddn_message',
+ 'not_our_message'
]
self.plugins_supporting_methods = {}
self.loaded = {}
log.debug('Plugin {} handled command {}.'.format(name, command))
continue
+ async def not_our_message(self, message):
+ for name in self.plugins():
+ if self.has_method(name, 'not_our_message'):
+ result = asyncio.ensure_future(self.call_coroutine(name, 'not_our_message', message))
+ if result is PluginCommand.ignored:
+ log.debug('Plugin {} ignored message.'.format(name))
+ continue
+ elif result is PluginCommand.exclusive:
+ log.info('Plugin {} handled message exclusively.'.format(name))
+ return True
+ elif result is PluginCommand.handled:
+ log.debug('Plugin {} handled message.'.format(name))
+ continue
+
async def handle_help(self, message, command, *args):
for name in self.method_cache('handle_help'):
if self.has_method(name, 'valid_commands'):