feat: Add a catch-all handler

This commit is contained in:
PapaTutuWawa 2021-06-13 19:42:45 +02:00
parent e953486494
commit 819b648c87

View File

@ -64,7 +64,8 @@ class PollenModule(BaseModule):
self._subcommand_table = {
'subscribe': self._subscribe,
'unsubscribe': self._unsubscribe,
'hilfe': self._help
'hilfe': self._help,
'*': self._any
}
self._sleep_duration = self.get_option('sleep_duration', 12 * 3600)
@ -262,5 +263,9 @@ Level: 0 (Kein Pollenflug) - 3 (Starker Pollenflug)
'''
self.send_message(msg.from_, body)
async def _any(self, cmd, msg):
self.send_message(msg.from_, 'Unbekannter Befehl')
await self._help(cmd, msg)
def get_instance(base, **kwargs):
return PollenModule.get_instance(base, **kwargs)