-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
47 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import tgram | ||
from typing import Union | ||
|
||
|
||
class DemoteChatMember: | ||
async def demote_chat_member( | ||
self: "tgram.TgBot", chat_id: Union[int, str], user_id: int | ||
) -> bool: | ||
""" | ||
Use this method to demote a user in a supergroup or a channel. The bot must be an administrator | ||
Telegram documentation: null | ||
:param chat_id: Unique identifier for the target chat or username of the target channel ( | ||
in the format @channelusername) | ||
:type chat_id: :obj:`int` or :obj:`str` | ||
:param user_id: Unique identifier of the target user | ||
:type user_id: :obj:`int` | ||
:return: True on success. | ||
:rtype: :obj:`bool` | ||
""" | ||
|
||
result = await self._send_request( | ||
"promoteChatMember", | ||
chat_id=chat_id, | ||
user_id=user_id, | ||
is_anonymous=False, | ||
can_manage_chat=False, | ||
can_delete_messages=False, | ||
can_manage_video_chats=False, | ||
can_restrict_members=False, | ||
can_promote_members=False, | ||
can_change_info=False, | ||
can_invite_users=False, | ||
can_post_stories=False, | ||
can_edit_stories=False, | ||
can_delete_stories=False, | ||
can_post_messages=False, | ||
can_edit_messages=False, | ||
can_pin_messages=False, | ||
can_manage_topics=False, | ||
) | ||
return result["result"] |