minor: Warn about missing usage handlers.

This commit is contained in:
Steve Howell 2020-04-05 10:50:17 +00:00 committed by showell
parent aee73b32e0
commit 2ec5bb7b70

View file

@ -337,7 +337,10 @@ def run_message_handler_for_bot(
print("Running {} Bot:".format(bot_details['name'])) print("Running {} Bot:".format(bot_details['name']))
if bot_details['description'] != "": if bot_details['description'] != "":
print("\n\t{}".format(bot_details['description'])) print("\n\t{}".format(bot_details['description']))
print(message_handler.usage()) if hasattr(message_handler, 'usage'):
print(message_handler.usage())
else:
print('WARNING: {} is missing usage handler, please add one eventually'.format(bot_name))
def handle_message(message: Dict[str, Any], flags: List[str]) -> None: def handle_message(message: Dict[str, Any], flags: List[str]) -> None:
logging.info('waiting for next message') logging.info('waiting for next message')