Skip to content

createNewSupergroupChat

Sahri Riza Umami edited this page Jul 2, 2018 · 1 revision

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

createNewSupergroupChat(title, is_channel, description, callback, data)
Field Type Description
title string Title of the new chat; 1-255 characters.
is_channel Bool True, if a channel chat should be created.
param_description string Chat description; 0-255 characters.

Example

  • Creates a new supergroup "Test Supergroup".

    createNewSupergroupChat('Test Supergroup', 0, 'Just a test group')

    Response:

    {
      ["@type"] = "chat",
      can_be_reported = false,
      client_data = "",
      id = -1001197978568,
      is_pinned = false,
      last_message = {
        ["@type"] = "message",
        author_signature = "",
        can_be_deleted_for_all_users = false,
        can_be_deleted_only_for_self = false,
        can_be_edited = false,
        can_be_forwarded = false,
        chat_id = -1001197978568,
        contains_unread_mention = false,
        content = {
          ["@type"] = "messageSupergroupChatCreate",
          title = "Test Supergroup"
        },
        date = 1530524371,
        edit_date = 0,
        id = 1048576,
        is_channel_post = false,
        is_outgoing = true,
        media_album_id = "0",
        reply_to_message_id = 0,
        sender_user_id = 133780085,
        ttl = 0,
        ttl_expires_in = 0,
        via_bot_user_id = 0,
        views = 0
      },
      last_read_inbox_message_id = 1048576,
      last_read_outbox_message_id = 0,
      notification_settings = {
        ["@type"] = "notificationSettings",
        mute_for = 0,
        show_preview = true,
        sound = "default"
      },
      order = "0",
      reply_markup_message_id = 0,
      title = "Test Supergroup",
      type = {
        ["@type"] = "chatTypeSupergroup",
        is_channel = false,
        supergroup_id = 1197978568
      },
      unread_count = 0,
      unread_mention_count = 0
    }

Frequently Asked Questions
The Functions

Clone this wiki locally