createChatInviteLink#
Returns: ChatInviteLink
- class aiogram.methods.create_chat_invite_link.CreateChatInviteLink(*, chat_id: Union[int, str], name: Optional[str] = None, expire_date: Optional[Union[datetime, timedelta, int]] = None, member_limit: Optional[int] = None, creates_join_request: Optional[bool] = 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: Union[int, str]#
Unique identifier for the target chat or username of the target channel (in the format
@channelusername
)
- name: Optional[str]#
Invite link name; 0-32 characters
- expire_date: Optional[Union[datetime, timedelta, int]]#
Point in time (Unix timestamp) when the link will expire
- member_limit: Optional[int]#
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: Optional[bool]#
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(...)