mirror of
https://github.com/aiogram/aiogram.git
synced 2025-12-08 17:13:56 +00:00
1.1 KiB
1.1 KiB
getChat
Description
Use this method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.). Returns a Chat object on success.
Arguments
| Name | Type | Description |
|---|---|---|
chat_id |
#!python3 Union[int, str] |
Unique identifier for the target chat or username of the target supergroup or channel (in the format @channelusername) |
Response
Type: #!python3 Chat
Description: Returns a Chat object on success.
Usage
As bot method bot
result: Chat = await bot.get_chat(...)
Method as object
Imports:
from aiogram.methods import GetChatfrom aiogram.api.methods import GetChatfrom aiogram.api.methods.get_chat import GetChat
In handlers with current bot
result: Chat = await GetChat(...)
With specific bot
result: Chat = await bot(GetChat(...))