From f15356c4c823895b947fcc94402c29fd7c66b07c Mon Sep 17 00:00:00 2001 From: "neiljp (Neil Pilgrim)" Date: Sun, 8 Apr 2018 15:47:13 -0700 Subject: [PATCH] wikipedia bot: Update bot & tests to use bot identity functionality. --- zulip_bots/zulip_bots/bots/wikipedia/test_wikipedia.py | 2 +- zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/zulip_bots/zulip_bots/bots/wikipedia/test_wikipedia.py b/zulip_bots/zulip_bots/bots/wikipedia/test_wikipedia.py index 98e96b6..0a7e60f 100755 --- a/zulip_bots/zulip_bots/bots/wikipedia/test_wikipedia.py +++ b/zulip_bots/zulip_bots/bots/wikipedia/test_wikipedia.py @@ -52,7 +52,7 @@ class TestWikipediaBot(BotTestCase): # Empty query, no request made to the Internet. bot_request = '' - bot_response = "Please enter your search term after @mention-bot" + bot_response = "Please enter your search term after @**test-bot**" self.verify_reply(bot_request, bot_response) # Incorrect status code diff --git a/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py b/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py index 65013b1..a7f7105 100644 --- a/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py +++ b/zulip_bots/zulip_bots/bots/wikipedia/wikipedia.py @@ -40,12 +40,12 @@ class WikipediaHandler(object): def get_bot_wiki_response(self, message: Dict[str, str], bot_handler: Any) -> Optional[str]: '''This function returns the URLs of the requested topic.''' - help_text = 'Please enter your search term after @mention-bot' + help_text = 'Please enter your search term after {}' # Checking if the link exists. query = message['content'] if query == '': - return help_text + return help_text.format(bot_handler.identity().mention) query_wiki_url = 'https://en.wikipedia.org/w/api.php' query_wiki_params = dict(