Airgram

Guides
/
/
Methods

api.createChatInviteLink()

Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges and can_invite_users right in the chat

Parameters CreateChatInviteLinkParams:

NameTypeDescription
chatIdnumber Chat identifier
namestring Invite link name; 0-32 characters
expirationDatenumber Point in time (Unix timestamp) when the link will expire; pass 0 if never
memberLimitnumber The maximum number of chat members that can join the chat via the link simultaneously; 0-99999; pass 0 if not limited
createsJoinRequestboolean True, if the link only creates join request. If true, member_limit must not be specified
Returns ApiResponse interface:
interface ApiResponse {
  _: 'createChatInviteLink' | 'error'
  airgram: Airgram
  request: {
    method: 'createChatInviteLink'
    params: CreateChatInviteLinkParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}