Browse Source

Added a message if /cr section is not found

master
Mikhail Chernov 8 years ago
parent
commit
745402c3c4
1 changed files with 4 additions and 0 deletions
  1. 4
    0
      magic-judge-telegram-bot.py

+ 4
- 0
magic-judge-telegram-bot.py View File

@@ -187,6 +187,10 @@ def comp_rules(bot, update, args):
elif not diff[-1:].isalpha():
other.append(name)

if not results:
update.message.reply_text('This section doesn\'t exist, my master!', quote=False)
return

text = '\n'.join(['<b>{}</b> {}'.format(name, crData['sections'][name][lang]) for name in results])
if other:
text += '\n<i>(Subsections: {}-{})</i>'.format(other[0], other[-1])

Loading…
Cancel
Save