diff --git a/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py b/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py index 9659273..506695a 100644 --- a/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py +++ b/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py @@ -18,6 +18,11 @@ class WikipediaHandler(object): kind of external issue tracker as well. ''' + META = { + 'name': 'Wikipedia', + 'description': 'Searches Wikipedia for a term and returns the top article.', + } + def usage(self): return ''' This plugin will allow users to directly search diff --git a/zulip_bots/zulip_bots/bots/xkcd/xkcd.py b/zulip_bots/zulip_bots/bots/xkcd/xkcd.py index d99c212..c1baca4 100644 --- a/zulip_bots/zulip_bots/bots/xkcd/xkcd.py +++ b/zulip_bots/zulip_bots/bots/xkcd/xkcd.py @@ -14,6 +14,11 @@ class XkcdHandler(object): commands. ''' + META = { + 'name': 'XKCD', + 'description': 'Fetches comic strips from https://xkcd.com.', + } + def usage(self): return ''' This plugin allows users to fetch a comic strip provided by diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index edc816f..5c5b63d 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -187,7 +187,17 @@ def run_message_handler_for_bot(lib_module, quiet, config_file, bot_name): state_handler = StateHandler() + # Set default bot_details, then override from class, if provided + bot_details = { + 'name': bot_name.capitalize(), + 'description': "", + } + bot_details.update(getattr(lib_module.handler_class, 'META', {})) + if not quiet: + print("Running {} Bot:".format(bot_details['name'])) + if bot_details['description'] != "": + print("\n\t{}".format(bot_details['description'])) print(message_handler.usage()) def handle_message(message):