diff --git a/hugvey/story.py b/hugvey/story.py index 0912782..c3fac7d 100644 --- a/hugvey/story.py +++ b/hugvey/story.py @@ -464,9 +464,10 @@ class Condition(object): if not story.lastMsgFinishTime: return False - msg = story.get(self.vars['msgId']) + msgId = self.vars['msgId'].strip() + msg = story.get(msgId) if not msg: - story.logger.critical(f"Condition on non-existing message: {self.vars['msgId']}") + story.logger.critical(f"Condition on non-existing message: {msgId}") # assigning false to r, keeps 'inverseMatch' working, even when msgId is wrong r = False else: @@ -474,7 +475,7 @@ class Condition(object): r = msg.isFinished() if r: - story.logger.debug(f"Msg {self.vars['msgId']} has been played.") + story.logger.debug(f"Msg {msgId} has been played.") if 'inverseMatch' in self.vars and self.vars['inverseMatch']: # inverse: @@ -482,7 +483,7 @@ class Condition(object): self.logInfo = "Has {} played msg {}".format( 'not' if 'inverseMatch' in self.vars and self.vars['inverseMatch'] else '', - self.vars['msgId'] + msgId ) return r