Skip to content

Commit

Permalink
guard need_reply
Browse files Browse the repository at this point in the history
  • Loading branch information
fopina committed Jan 26, 2016
1 parent 988f8e7 commit 3a94438
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions plugins/euromillions.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,10 @@ def results(self, message, text):
reply_markup=ForceReply.create(selective=True),
parse_mode='Markdown'
).wait()
self.need_reply(self.results, message, out_message=m, selective=True)
if isinstance(m, Error):
print 'ERROR:', m
else:
self.need_reply(self.results, message, out_message=m, selective=True)
return

try:
Expand All @@ -105,7 +108,10 @@ def results(self, message, text):
reply_markup=ForceReply.create(selective=True),
parse_mode='Markdown'
).wait()
self.need_reply(self.results, message, out_message=m, selective=True)
if isinstance(m, Error):
print 'ERROR:', m
else:
self.need_reply(self.results, message, out_message=m, selective=True)

def _short_results(self, entry='latest'):
return u'\U0001F3BE %(numbers)s \U00002B50 %(stars)s' % self.read_data('results', entry)
Expand Down

0 comments on commit 3a94438

Please sign in to comment.