Airgram

Guides
/
/
Methods

api.createNewSupergroupChat()

Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created chat

Parameters CreateNewSupergroupChatParams:

NameTypeDescription
titlestring Title of the new chat; 1-128 characters
isChannelboolean True, if a channel chat needs to be created
descriptionstring Chat description; 0-255 characters
location Chat location if a location-based supergroup is being created; pass null to create an ordinary supergroup chat
forImportboolean True, if the supergroup is created for importing messages using importMessage
Returns ApiResponse interface:
interface ApiResponse {
  _: 'createNewSupergroupChat' | 'error'
  airgram: Airgram
  request: {
    method: 'createNewSupergroupChat'
    params: CreateNewSupergroupChatParams
  }
  response:  | 
  setState: (nextState: Record<string, unknown>) => void
  getState: () => Record<string, unknown>
}