Skip to content

Commit

Permalink
fixed maximum recursion depth while parsing msg
Browse files Browse the repository at this point in the history
  • Loading branch information
rking32 committed Jul 3, 2022
1 parent d25e8fb commit 394afc3
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions userge/core/types/bound/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,9 @@ def parse(cls, client: Union['_client.Userge', '_client.UsergeBot'],
if isinstance(message, Message):
return message
mvars = vars(message)
if mvars['reply_to_message']:
mvars['reply_to_message'] = cls.parse(client, mvars['reply_to_message'], **kwargs)
if mvars['reply_to_message'] and not kwargs.pop("stop", False):
mvars['reply_to_message'] = cls.parse(client, mvars['reply_to_message'],
stop=True, **kwargs)
mvars["client"] = mvars.pop("_client", None) or client
return cls(mvars, **kwargs)

Expand Down

0 comments on commit 394afc3

Please sign in to comment.