mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2026-01-07 15:34:52 +00:00
Move ACTIONS outside the method
This commit is contained in:
parent
cb509ba4db
commit
79e972df85
1 changed files with 17 additions and 17 deletions
|
|
@ -454,11 +454,7 @@ class Client:
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
def send_chat_action(self,
|
ACTIONS = {
|
||||||
chat_id: int or str,
|
|
||||||
action: str,
|
|
||||||
progress: int = 0):
|
|
||||||
actions = {
|
|
||||||
"cancel": types.SendMessageCancelAction,
|
"cancel": types.SendMessageCancelAction,
|
||||||
"typing": types.SendMessageTypingAction,
|
"typing": types.SendMessageTypingAction,
|
||||||
"playing": types.SendMessageGamePlayAction,
|
"playing": types.SendMessageGamePlayAction,
|
||||||
|
|
@ -474,10 +470,14 @@ class Client:
|
||||||
"upload_video_note": types.SendMessageUploadRoundAction,
|
"upload_video_note": types.SendMessageUploadRoundAction,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def send_chat_action(self,
|
||||||
|
chat_id: int or str,
|
||||||
|
action: str,
|
||||||
|
progress: int = 0):
|
||||||
return self.send(
|
return self.send(
|
||||||
functions.messages.SetTyping(
|
functions.messages.SetTyping(
|
||||||
peer=self.resolve_peer(chat_id),
|
peer=self.resolve_peer(chat_id),
|
||||||
action=actions.get(
|
action=self.ACTIONS.get(
|
||||||
action.lower()
|
action.lower()
|
||||||
)(progress=progress)
|
)(progress=progress)
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue