wikipedia bot: Update bot & tests to use bot identity functionality.
This commit is contained in:
parent
56c59d915a
commit
f15356c4c8
|
@ -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
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in a new issue