From 3cf26e47fa503bed4ca3f22bd510c1bf2cc1a8e4 Mon Sep 17 00:00:00 2001 From: Yusuf_M_Thon_iD <32301831+Sunda001@users.noreply.github.com> Date: Wed, 16 Dec 2020 14:18:52 +0700 Subject: [PATCH] fixed --- telethon/events/chataction.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/telethon/events/chataction.py b/telethon/events/chataction.py index a6c3b97f..1de8fd38 100644 --- a/telethon/events/chataction.py +++ b/telethon/events/chataction.py @@ -11,7 +11,7 @@ class ChatAction(EventBuilder): * Whenever a new chat is created. * Whenever a chat's title or photo is changed or removed. * Whenever a new message is pinned. - * Whenever a user scores in a game. + * Whenever a user scores in a game. * Whenever a user joins or is added to the group. * Whenever a user is removed or leaves a group if it has less than 50 members or the removed user was a bot. @@ -30,6 +30,7 @@ class ChatAction(EventBuilder): if event.user_joined: await event.reply('Welcome to the group!') """ + @classmethod def build(cls, update, others=None, self_id=None): # Rely on specific pin updates for unpins, but otherwise ignore them @@ -116,9 +117,8 @@ class ChatAction(EventBuilder): pin_ids=[msg.reply_to_msg_id]) elif isinstance(action, types.MessageActionGameScore): return cls.Event(msg, - game_id=action.game_id, - score=action.score) - + new_score=action.score) + class Event(EventCommon): """ Represents the event of a new chat action. @@ -157,9 +157,10 @@ class ChatAction(EventBuilder): unpin (`bool`): `True` if the existing pin gets unpinned. """ + def __init__(self, where, new_photo=None, added_by=None, kicked_by=None, created=None, - users=None, new_title=None, pin_ids=None, pin=None): + users=None, new_title=None, pin_ids=None, pin=None, new_score=None): if isinstance(where, types.MessageService): self.action_message = where where = where.peer_id @@ -209,6 +210,7 @@ class ChatAction(EventBuilder): self._users = None self._input_users = None self.new_title = new_title + self.new_score = new_score self.unpin = not pin def _set_client(self, client):