def on_message(self, msg):
debug('GameDialog on_message')
content_type = telepot.glance(msg)[0]
if content_type != 'text':
return
text = msg['text']
if text.startswith('/command'):
text = text[9:]
elif text.startswith('/c'):
text = text[3:]
if text.lower() in ['save', 'restore', 'quit', 'q']:
await self._sender.sendMessage('This command currently unsupported',
reply_markup=self._KEYBOARD)
return DIALOG_GAME, {}
elif text == self._RETURN:
return DIALOG_MAIN, {}
elif not text:
return DIALOG_GAME, {}
else:
await self._game.command(text)
return DIALOG_GAME, {}
评论列表
文章目录