diff --git a/zulip_bots/zulip_bots/lib.py b/zulip_bots/zulip_bots/lib.py index 5d1b362..62768d6 100644 --- a/zulip_bots/zulip_bots/lib.py +++ b/zulip_bots/zulip_bots/lib.py @@ -126,7 +126,7 @@ class StateHandler(object): yield new_state self.set_state(new_state) -def run_message_handler_for_bot(lib_module, quiet, config_file): +def run_message_handler_for_bot(lib_module, quiet, config_file, bot_name): # type: (Any, bool, str) -> Any # # lib_module is of type Any, since it can contain any bot's @@ -135,7 +135,7 @@ def run_message_handler_for_bot(lib_module, quiet, config_file): # function. # # Make sure you set up your ~/.zuliprc - client = Client(config_file=config_file) + client = Client(config_file=config_file, client="Zulip{}Bot".format(bot_name.capitalize())) restricted_client = ExternalBotHandler(client) message_handler = lib_module.handler_class() diff --git a/zulip_bots/zulip_bots/run.py b/zulip_bots/zulip_bots/run.py index e8cc7e9..93179cc 100755 --- a/zulip_bots/zulip_bots/run.py +++ b/zulip_bots/zulip_bots/run.py @@ -107,7 +107,8 @@ def main(): run_message_handler_for_bot( lib_module=lib_module, config_file=options.config_file, - quiet=options.quiet + quiet=options.quiet, + bot_name=bot_name ) if __name__ == '__main__':