From cebecb99c0e53d4de22a335540d84919658e5521 Mon Sep 17 00:00:00 2001 From: Abir Hasan Date: Mon, 13 Dec 2021 18:20:55 +0600 Subject: [PATCH 1/2] Fix renamed raw API function (#810) `raw.functions.channels.DeleteUserHistory` to `raw.functions.channels.DeleteParticipantHistory` --- pyrogram/methods/chats/delete_user_history.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyrogram/methods/chats/delete_user_history.py b/pyrogram/methods/chats/delete_user_history.py index e2f780f9..8043432d 100644 --- a/pyrogram/methods/chats/delete_user_history.py +++ b/pyrogram/methods/chats/delete_user_history.py @@ -42,9 +42,9 @@ class DeleteUserHistory(Scaffold): """ r = await self.send( - raw.functions.channels.DeleteUserHistory( + raw.functions.channels.DeleteParticipantHistory( channel=await self.resolve_peer(chat_id), - user_id=await self.resolve_peer(user_id) + participant=await self.resolve_peer(user_id) ) ) From 6fb427fb9a61bfcd31494f65c948bcb3b9d1d676 Mon Sep 17 00:00:00 2001 From: Adek Date: Fri, 17 Dec 2021 16:41:39 +0700 Subject: [PATCH 2/2] Add new chat actions (#751) * Add new chat action * Update send_chat_action.py Co-authored-by: Dan <14043624+delivrance@users.noreply.github.com> --- pyrogram/methods/messages/send_chat_action.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyrogram/methods/messages/send_chat_action.py b/pyrogram/methods/messages/send_chat_action.py index 586d1ea7..f618670d 100644 --- a/pyrogram/methods/messages/send_chat_action.py +++ b/pyrogram/methods/messages/send_chat_action.py @@ -37,6 +37,8 @@ class ChatAction: PLAYING = raw.types.SendMessageGamePlayAction CHOOSE_CONTACT = raw.types.SendMessageChooseContactAction SPEAKING = raw.types.SpeakingInGroupCallAction + IMPORT_HISTORY = raw.types.SendMessageHistoryImportAction + CHOOSE_STICKER = raw.types.SendMessageChooseStickerAction CANCEL = raw.types.SendMessageCancelAction @@ -59,6 +61,7 @@ class SendChatAction(Scaffold): *"record_audio"* or *"upload_audio"* for audio files, *"upload_document"* for general files, *"find_location"* for location data, *"record_video_note"* or *"upload_video_note"* for video notes, *"choose_contact"* for contacts, *"playing"* for games, *"speaking"* for speaking in group calls or + *"import_history"* for importing history, *"choose_sticker"* for stickers or *"cancel"* to cancel any chat action currently displayed. Returns: @@ -89,7 +92,7 @@ class SendChatAction(Scaffold): raise ValueError("Invalid chat action '{}'. Possible values are: {}".format( action, json.dumps(POSSIBLE_VALUES, indent=4))) from None - if "Upload" in action.__name__: + if "Upload" in action.__name__ or "History" in action.__name__: action = action(progress=0) else: action = action()