mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
25 lines
872 B
Python
25 lines
872 B
Python
from typing import Any, Dict, Union
|
|
|
|
from ..types import ChatPermissions
|
|
from .base import Request, TelegramMethod
|
|
|
|
|
|
class SetChatPermissions(TelegramMethod[bool]):
|
|
"""
|
|
Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members admin rights. Returns True on success.
|
|
|
|
Source: https://core.telegram.org/bots/api#setchatpermissions
|
|
"""
|
|
|
|
__returning__ = bool
|
|
|
|
chat_id: Union[int, str]
|
|
"""Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername)"""
|
|
|
|
permissions: ChatPermissions
|
|
"""New default chat permissions"""
|
|
|
|
def build_request(self) -> Request:
|
|
data: Dict[str, Any] = self.dict()
|
|
|
|
return Request(method="setChatPermissions", data=data)
|