def _process_event(self, event):
'Processes an event sent to the bot.'
unknown_reactions = [
'I don\'t think I understand you correctly.\nCould you rephrase what you meant?',
'I\'m not sure I know what you mean by that.',
'Could you elaborate on this?',
'I couldn\'t catch what you meant.\nCould you say it differently?',
]
is_understandable = False
self._send_typing(event['channel'])
for keyword in self._keywords:
if keyword in event['text']:
is_understandable = True
if is_understandable:
self._send_typing(event['channel'])
self._send_menus(event)
elif not is_understandable:
self._send_message(
event['channel'],
unknown_reactions[random.randint(0, len(unknown_reactions) - 1)])
return
评论列表
文章目录