From 12e81fd0246ba8b97358dc616d742bce3d4a2c75 Mon Sep 17 00:00:00 2001 From: Krzysztof Krzysztof Date: Wed, 24 May 2017 12:23:50 -0700 Subject: [PATCH] bots: Add empty message support in Wikipedia bot. --- contrib_bots/bots/wikipedia/wikipedia.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/contrib_bots/bots/wikipedia/wikipedia.py b/contrib_bots/bots/wikipedia/wikipedia.py index 3506232..5c94f6f 100644 --- a/contrib_bots/bots/wikipedia/wikipedia.py +++ b/contrib_bots/bots/wikipedia/wikipedia.py @@ -31,7 +31,10 @@ class WikipediaHandler(object): client.send_reply(message, bot_response) def get_bot_wiki_response(self, message, client): + help_text = 'Please enter your message after @mention-bot' query = message['content'] + if query == '': + return help_text query_wiki_link = ('https://en.wikipedia.org/w/api.php?action=query&' 'list=search&srsearch=%s&format=json' % (query,)) try: