createChatInviteLink¶
Returns: ChatInviteLink
- class aiogram.methods.create_chat_invite_link.CreateChatInviteLink(*, chat_id: int | str, name: str | None = None, expire_date: datetime | timedelta | int | None = None, member_limit: int | None = None, creates_join_request: bool | None = None, **extra_data: Any)[source]¶
Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method
aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink
. Returns the new invite link asaiogram.types.chat_invite_link.ChatInviteLink
object.Source: https://core.telegram.org/bots/api#createchatinvitelink
- chat_id: int | str¶
Unique identifier for the target chat or username of the target channel (in the format
@channelusername
)
- name: str | None¶
Invite link name; 0-32 characters
- expire_date: datetime.datetime | datetime.timedelta | int | None¶
Point in time (Unix timestamp) when the link will expire
- model_computed_fields: ClassVar[Dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- model_post_init(context: Any, /) None ¶
We need to both initialize private attributes and call the user-defined model_post_init method.
- member_limit: int | None¶
The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999
- creates_join_request: bool | None¶
True
, if users joining the chat via the link need to be approved by chat administrators. IfTrue
, member_limit can’t be specified
Usage¶
As bot method¶
result: ChatInviteLink = await bot.create_chat_invite_link(...)
Method as object¶
Imports:
from aiogram.methods.create_chat_invite_link import CreateChatInviteLink
alias:
from aiogram.methods import CreateChatInviteLink
With specific bot¶
result: ChatInviteLink = await bot(CreateChatInviteLink(...))
As reply into Webhook in handler¶
return CreateChatInviteLink(...)