mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-03 14:04:51 +00:00
pyrofork: Fix UnboundLocalError: local variable 'from_user' referenced before assignment
Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
7c0481d2f0
commit
955b261101
1 changed files with 3 additions and 2 deletions
|
|
@ -742,6 +742,9 @@ class Message(Object, Update):
|
|||
|
||||
service_type = None
|
||||
|
||||
from_user = types.User._parse(client, users.get(user_id, None))
|
||||
sender_chat = types.Chat._parse(client, message, users, chats, is_chat=False) if not from_user else None
|
||||
|
||||
if isinstance(action, raw.types.MessageActionChatAddUser):
|
||||
new_chat_members = [types.User._parse(client, users[i]) for i in action.users]
|
||||
service_type = enums.MessageServiceType.NEW_CHAT_MEMBERS
|
||||
|
|
@ -839,8 +842,6 @@ class Message(Object, Update):
|
|||
elif isinstance(action, (raw.types.MessageActionPaymentSent, raw.types.MessageActionPaymentSentMe)):
|
||||
successful_payment = types.SuccessfulPayment._parse(client, action)
|
||||
service_type = enums.MessageServiceType.SUCCESSFUL_PAYMENT
|
||||
from_user = types.User._parse(client, users.get(user_id, None))
|
||||
sender_chat = types.Chat._parse(client, message, users, chats, is_chat=False) if not from_user else None
|
||||
|
||||
parsed_message = Message(
|
||||
id=message.id,
|
||||
|
|
|
|||
Loading…
Reference in a new issue