MCPcopy Index your code
hub / github.com/python-telegram-bot/python-telegram-bot / get_chat_member

Method get_chat_member

src/telegram/_bot.py:5085–5116  ·  view source on GitHub ↗

Use this method to get information about a member of a chat. The method is only guaranteed to work for other users if the bot is an administrator in the chat. Args: chat_id (:obj:`int` | :obj:`str`): |chat_id_channel| user_id (:obj:`int`): Unique identifier o

(
        self,
        chat_id: str | int,
        user_id: int,
        *,
        read_timeout: ODVInput[float] = DEFAULT_NONE,
        write_timeout: ODVInput[float] = DEFAULT_NONE,
        connect_timeout: ODVInput[float] = DEFAULT_NONE,
        pool_timeout: ODVInput[float] = DEFAULT_NONE,
        api_kwargs: JSONDict | None = None,
    )

Source from the content-addressed store, hash-verified

5083 )
5084
5085 async def get_chat_member(
5086 self,
5087 chat_id: str | int,
5088 user_id: int,
5089 *,
5090 read_timeout: ODVInput[float] = DEFAULT_NONE,
5091 write_timeout: ODVInput[float] = DEFAULT_NONE,
5092 connect_timeout: ODVInput[float] = DEFAULT_NONE,
5093 pool_timeout: ODVInput[float] = DEFAULT_NONE,
5094 api_kwargs: JSONDict | None = None,
5095 ) -> ChatMember:
5096 """Use this method to get information about a member of a chat. The method is only
5097 guaranteed to work for other users if the bot is an administrator in the chat.
5098
5099 Args:
5100 chat_id (:obj:`int` | :obj:`str`): |chat_id_channel|
5101 user_id (:obj:`int`): Unique identifier of the target user.
5102
5103 Returns:
5104 :class:`telegram.ChatMember`
5105 """
5106 data: JSONDict = {"chat_id": chat_id, "user_id": user_id}
5107 result = await self._post(
5108 "getChatMember",
5109 data,
5110 read_timeout=read_timeout,
5111 write_timeout=write_timeout,
5112 connect_timeout=connect_timeout,
5113 pool_timeout=pool_timeout,
5114 api_kwargs=api_kwargs,
5115 )
5116 return ChatMember.de_json(result, self)
5117
5118 async def set_chat_sticker_set(
5119 self,

Callers 6

get_memberMethod · 0.45
test_get_chat_memberMethod · 0.45
webhook_updateFunction · 0.45
webhook_updateFunction · 0.45
webhook_updateFunction · 0.45
webhook_updateFunction · 0.45

Calls 2

_postMethod · 0.95
de_jsonMethod · 0.45

Tested by 1

test_get_chat_memberMethod · 0.36