Skip to content

Commit

Permalink
Fix saying status
Browse files Browse the repository at this point in the history
  • Loading branch information
airenas committed Sep 1, 2022
1 parent b4c30a1 commit 9521cd8
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sage/bot.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,21 @@ def process(self, txt: str):
self.__out_func(Data(in_type=DataType.TEXT_RESULT, data=round_number(res), who=Sender.BOT))
except UnknownLeave as err:
logger.error(err)
self.__send_status("saying")
self.__out_func(Data(in_type=DataType.TEXT, data="Nežinau žodžio '%s'" % err.string, who=Sender.BOT))
except UnknownWord as err:
logger.error(err)
if err.word == "<unk>":
self.__send_status("saying")
self.__out_func(
Data(in_type=DataType.TEXT, data="Pasakėte kažkokį nežinomą žodį", who=Sender.BOT))
else:
self.__send_status("saying")
self.__out_func(
Data(in_type=DataType.TEXT, data="Nežinau ką daryti su žodžiu '%s'" % err.word, who=Sender.BOT))
except BaseException as err:
logger.error(err)
self.__send_status("saying")
self.__out_func(Data(in_type=DataType.TEXT, data="Deja, kažkokia klaida!", who=Sender.BOT))
self.__send_status("waiting")

Expand Down

0 comments on commit 9521cd8

Please sign in to comment.