From aae93c155b0d073ac67eb7e211a61596fe04b1a9 Mon Sep 17 00:00:00 2001 From: Yusuf_M_Thon_iD <32301831+Sunda001@users.noreply.github.com> Date: Tue, 15 Dec 2020 11:21:39 +0700 Subject: [PATCH] chat action new chat action for GameScore --- telethon/events/chataction.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/telethon/events/chataction.py b/telethon/events/chataction.py index 6427f85a..a6c3b97f 100644 --- a/telethon/events/chataction.py +++ b/telethon/events/chataction.py @@ -11,6 +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 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. @@ -113,7 +114,11 @@ class ChatAction(EventBuilder): elif isinstance(action, types.MessageActionPinMessage) and msg.reply_to: return cls.Event(msg, pin_ids=[msg.reply_to_msg_id]) - + elif isinstance(action, types.MessageActionGameScore): + return cls.Event(msg, + game_id=action.game_id, + score=action.score) + class Event(EventCommon): """ Represents the event of a new chat action.