Link Search Menu Expand Document

Constructor: channel

Back to constructors index

Channel/supergroup info

When updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren’t set in the new constructor).

The only exception to the above rule is when the min flag is set, in which case only the following fields must be applied over any locally stored version:

  • title
  • megagroup
  • color
  • photo
  • username
  • usernames
  • has_geo
  • noforwards
  • emoji_status
  • has_link
  • slow_mode_enabled
  • scam
  • fake
  • gigagroup
  • forum
  • level
  • restricted
  • restriction_reason
  • join_to_send
  • join_request
  • is_verified
  • default_banned_rights
  • signature_profiles

See here » for an implementation of the logic to use when updating the local user peer database.

Attributes:

NameTypeRequiredDescription
creatorBoolOptionalWhether the current user is the creator of this channel
leftBoolOptionalWhether the current user has left or is not a member of this channel
broadcastBoolOptionalIs this a channel?
verifiedBoolOptionalIs this channel verified by telegram?
megagroupBoolOptionalIs this a supergroup?
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
restrictedBoolOptionalWhether viewing/writing in this channel for a reason (see restriction_reason)
signaturesBoolOptionalWhether signatures are enabled (channels)
minBoolOptionalSee min
scamBoolOptionalThis channel/supergroup is probably a scam
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
has_linkBoolOptionalWhether this channel has a linked discussion group » (or this supergroup is a channel’s discussion group). The actual ID of the linked channel/supergroup is contained in channelFull.linked_chat_id.
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
has_geoBoolOptionalWhether this chanel has a geoposition
slowmode_enabledBoolOptionalWhether slow mode is enabled for groups to prevent flood in chat.
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
call_activeBoolOptionalWhether a group call or livestream is currently active
call_not_emptyBoolOptionalWhether there’s anyone in the group call or livestream
fakeBoolOptionalIf set, this supergroup/channel was reported by many users as a fake or scam: be careful when interacting with it.
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
gigagroupBoolOptionalWhether this supergroup is a gigagroup
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
noforwardsBoolOptionalWhether this channel or group is protected, thus does not allow forwarding messages from it
join_to_sendBoolOptionalWhether a user needs to join the supergroup before they can send messages: can be false only for discussion groups », toggle using channels.toggleJoinToSend
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
join_requestBoolOptionalWhether a user’s join request will have to be approved by administrators, toggle using channels.toggleJoinToSend
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
forumBoolOptionalWhether this supergroup is a forum.
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
stories_hiddenBoolOptional
stories_hidden_minBoolOptional
stories_unavailableBoolOptional
signature_profilesBoolOptional
idlongYesID of the channel, see here » for more info
access_hashlongOptionalAccess hash, see here » for more info
titlestringYesTitle
usernamestringOptionalMain active username.
photoChatPhotoOptionalProfile photo
dateintYesDate when the user joined the supergroup/channel, or if the user isn’t a member, its creation date
restriction_reasonArray of RestrictionReasonOptionalContains the reason why access to this channel must be restricted.
Changes to this flag should invalidate the local channelFull cache for this channel/supergroup ID, see here » for more info.
admin_rightsChatAdminRightsOptionalAdmin rights of the user in this channel (see rights)
banned_rightsChatBannedRightsOptionalBanned rights of the user in this channel (see rights)
default_banned_rightsChatBannedRightsOptionalDefault chat rights (see rights)
participants_countintOptionalParticipant count
usernamesArray of UsernameOptional
stories_max_idintOptional
colorPeerColorOptional
profile_colorPeerColorOptional
emoji_statusEmojiStatusOptional
levelintOptional
subscription_until_dateintOptional
bot_verification_iconlongOptional

Type: Chat

Example:

$channel = ['_' => 'channel', 'creator' => Bool, 'left' => Bool, 'broadcast' => Bool, 'verified' => Bool, 'megagroup' => Bool, 'restricted' => Bool, 'signatures' => Bool, 'min' => Bool, 'scam' => Bool, 'has_link' => Bool, 'has_geo' => Bool, 'slowmode_enabled' => Bool, 'call_active' => Bool, 'call_not_empty' => Bool, 'fake' => Bool, 'gigagroup' => Bool, 'noforwards' => Bool, 'join_to_send' => Bool, 'join_request' => Bool, 'forum' => Bool, 'stories_hidden' => Bool, 'stories_hidden_min' => Bool, 'stories_unavailable' => Bool, 'signature_profiles' => Bool, 'id' => long, 'access_hash' => long, 'title' => 'string', 'username' => 'string', 'photo' => ChatPhoto, 'date' => int, 'restriction_reason' => [RestrictionReason, RestrictionReason], 'admin_rights' => ChatAdminRights, 'banned_rights' => ChatBannedRights, 'default_banned_rights' => ChatBannedRights, 'participants_count' => int, 'usernames' => [Username, Username], 'stories_max_id' => int, 'color' => PeerColor, 'profile_color' => PeerColor, 'emoji_status' => EmojiStatus, 'level' => int, 'subscription_until_date' => int, 'bot_verification_icon' => long];