Skip to content

createNewChannelChat

Sahri Riza Umami edited this page Jun 9, 2017 · 4 revisions

Creates new channel chat and send corresponding messageChannelChatCreate, returns created chat.

createNewChannelChat(title, is_supergroup, about)
Option Description
title Title of new channel chat, 0-255 characters.
is_supergroup true, if supergroup chat should be created.
about Information about the channel, 0-255 characters.

Example

  • Create super group

    createNewChannelChat('My SuperGroup', 1, 'My Supergroup, my rules')

    Response:

    {
      ID = "Chat",
      draft_message_ = false,
      id_ = "-1001138736494",
      last_read_inbox_message_id_ = 1048576,
      last_read_outbox_message_id_ = 0,
      notification_settings_ = {
        ID = "NotificationSettings",
        mute_for_ = 0,
        show_preview_ = true,
        sound_ = "default"
      },
      order_ = "6429544069059313665",
      photo_ = false,
      reply_markup_message_id_ = 0,
      title_ = "My SuperGroup",
      top_message_ = {
        ID = "Message",
        can_be_deleted_ = false,
        can_be_edited_ = false,
        chat_id_ = "-1001138736494",
        content_ = {
          ID = "MessageChannelChatCreate",
          title_ = "My SuperGroup"
        },
        date_ = 1496994884,
        edit_date_ = 0,
        forward_info_ = false,
        id_ = 1048576,
        is_post_ = false,
        reply_markup_ = false,
        reply_to_message_id_ = 0,
        send_state_ = {
          ID = "MessageIsSuccessfullySent"
        },
        sender_user_id_ = 194211431,
        ttl_ = 0,
        ttl_expires_in_ = 0,
        via_bot_user_id_ = 0,
        views_ = 0
      },
      type_ = {
        ID = "ChannelChatInfo",
        channel_ = {
          ID = "Channel",
          anyone_can_invite_ = false,
          date_ = 1496994884,
          id_ = 1138736494,
          is_supergroup_ = true,
          is_verified_ = false,
          restriction_reason_ = false,
          sign_messages_ = true,
          status_ = {
            ID = "ChatMemberStatusCreator"
          },
          username_ = false
        }
      },
      unread_count_ = 0
    }
  • Create a channel

    createNewChannelChat('My Channel', 0, 'My Channel, my rules')

    Response:

    {
      ID = "Chat",
      draft_message_ = false,
      id_ = "-1001139119329",
      last_read_inbox_message_id_ = 1048576,
      last_read_outbox_message_id_ = "2251799812636672",
      notification_settings_ = {
        ID = "NotificationSettings",
        mute_for_ = 0,
        show_preview_ = true,
        sound_ = "default"
      },
      order_ = "6429542986727555073",
      photo_ = false,
      reply_markup_message_id_ = 0,
      title_ = "My Channel",
      top_message_ = {
        ID = "Message",
        can_be_deleted_ = false,
        can_be_edited_ = false,
        chat_id_ = "-1001139119329",
        content_ = {
          ID = "MessageChannelChatCreate",
          title_ = "My Channel"
        },
        date_ = 1496994632,
        edit_date_ = 0,
        forward_info_ = false,
        id_ = 1048576,
        is_post_ = true,
        reply_markup_ = false,
        reply_to_message_id_ = 0,
        send_state_ = {
          ID = "MessageIsSuccessfullySent"
        },
        sender_user_id_ = 0,
        ttl_ = 0,
        ttl_expires_in_ = 0,
        via_bot_user_id_ = 0,
        views_ = 0
      },
      type_ = {
        ID = "ChannelChatInfo",
        channel_ = {
          ID = "Channel",
          anyone_can_invite_ = false,
          date_ = 1496994632,
          id_ = 1139119329,
          is_supergroup_ = false,
          is_verified_ = false,
          restriction_reason_ = false,
          sign_messages_ = false,
          status_ = {
            ID = "ChatMemberStatusCreator"
          },
          username_ = false
        }
      },
      unread_count_ = 0
    }

Test script
Frequently Asked Questions
The Functions

Clone this wiki locally