Documentation

Chat extends Entity
in package

Class Chat

Tags
link
https://core.telegram.org/bots/api#chat

Table of Contents

$all_members_are_administrators  : bool
$can_set_sticker_set  : bool
$description  : string
$first_name  : string
$id  : int
$invite_link  : string
$last_name  : string
$photo  : ChatPhoto
$sticker_set_name  : string
$title  : string
$type  : string
$username  : string
__call()  : mixed|null
Return the variable for the called getter or magically set properties dynamically.
__construct()  : mixed
Entity constructor.
__toString()  : string
Perform to string
escapeMarkdown()  : string
Escape markdown special characters
getAllMembersAreAdministrators()  :
getBotUsername()  :
getCanSetStickerSet()  :
getDescription()  :
getFirstName()  :
getId()  :
getInviteLink()  :
getLastName()  :
getPhoto()  :
getPinnedMessage()  :
getProperty()  : mixed
Get a property from the current Entity
getRawData()  :
getStickerSetName()  :
getTitle()  :
getType()  :
getUsername()  :
isChannel()  : bool
Check if this is a channel
isGroupChat()  : bool
Check if this is a group chat
isPrivateChat()  : bool
Check if this is a private chat
isSuperGroup()  : bool
Check if this is a super group
subEntities()  : array<string|int, mixed>
Get the list of the properties that are themselves Entities
toJson()  : string
Perform to json
tryMention()  : string|null
Try to mention the user of this chat, else return the title
assignMemberVariables()  : mixed
Helper to set member variables
makePrettyObjectArray()  : array<string|int, mixed>
Return an array of nice objects from an array of object arrays
validate()  : mixed
Perform any special entity validation

Properties

$all_members_are_administrators

public bool $all_members_are_administrators

Optional. True if a group has ‘All Members Are Admins’ enabled.

$can_set_sticker_set

public bool $can_set_sticker_set

Optional. True, if the bot can change group the sticker set. Returned only in getChat.

$description

public string $description

Optional. Description, for supergroups and channel chats. Returned only in getChat.

$first_name

public string $first_name

Optional. First name of the other party in a private chat

$id

public int $id

Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

public string $invite_link

Optional. Chat invite link, for supergroups and channel chats. Returned only in getChat.

$last_name

public string $last_name

Optional. Last name of the other party in a private chat

$photo

public ChatPhoto $photo

Optional. Chat photo. Returned only in getChat.

$sticker_set_name

public string $sticker_set_name

Optional. For supergroups, name of Group sticker set. Returned only in getChat.

$title

public string $title

Optional. Title, for channels and group chats

$type

public string $type

Type of chat, can be either "private", "group", "supergroup" or "channel"

$username

public string $username

Optional. Username, for private chats, supergroups and channels if available

Methods

__call()

Return the variable for the called getter or magically set properties dynamically.

public __call( $method,  $args) : mixed|null
Parameters
$method :
$args :
Return values
mixed|null

__construct()

Entity constructor.

public __construct(mixed $data) : mixed
Parameters
$data : mixed
Return values
mixed

__toString()

Perform to string

public __toString() : string
Return values
string

escapeMarkdown()

Escape markdown special characters

public escapeMarkdown(string $string) : string
Parameters
$string : string
Return values
string

getAllMembersAreAdministrators()

public getAllMembersAreAdministrators() :

Optional. True if a group has ‘All Members Are Admins’ enabled.

Return values

getBotUsername()

public getBotUsername() :

Return the bot name passed to this entity

Return values

getCanSetStickerSet()

public getCanSetStickerSet() :

Optional. True, if the bot can change group the sticker set. Returned only in getChat.

Return values

getDescription()

public getDescription() :

Optional. Description, for supergroups and channel chats. Returned only in getChat.

Return values

getFirstName()

public getFirstName() :

Optional. First name of the other party in a private chat

Return values

getId()

public getId() :

Unique identifier for this chat. This number may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier.

Return values
public getInviteLink() :

Optional. Chat invite link, for supergroups and channel chats. Returned only in getChat.

Return values

getLastName()

public getLastName() :

Optional. Last name of the other party in a private chat

Return values

getPhoto()

public getPhoto() :

Optional. Chat photo. Returned only in getChat.

Return values

getPinnedMessage()

public getPinnedMessage() :

Optional. Pinned message, for supergroups. Returned only in getChat.

Return values

getProperty()

Get a property from the current Entity

public getProperty(mixed $property[, mixed $default = null ]) : mixed
Parameters
$property : mixed
$default : mixed = null
Return values
mixed

getRawData()

public getRawData() :

Get the raw data passed to this entity

Return values

getStickerSetName()

public getStickerSetName() :

Optional. For supergroups, name of Group sticker set. Returned only in getChat.

Return values

getTitle()

public getTitle() :

Optional. Title, for channels and group chats

Return values

getType()

public getType() :

Type of chat, can be either "private ", "group", "supergroup" or "channel"

Return values

getUsername()

public getUsername() :

Optional. Username, for private chats, supergroups and channels if available

Return values

isChannel()

Check if this is a channel

public isChannel() : bool
Return values
bool

isGroupChat()

Check if this is a group chat

public isGroupChat() : bool
Return values
bool

isPrivateChat()

Check if this is a private chat

public isPrivateChat() : bool
Return values
bool

isSuperGroup()

Check if this is a super group

public isSuperGroup() : bool
Return values
bool

subEntities()

Get the list of the properties that are themselves Entities

public subEntities() : array<string|int, mixed>
Return values
array<string|int, mixed>

toJson()

Perform to json

public toJson() : string
Return values
string

tryMention()

Try to mention the user of this chat, else return the title

public tryMention([bool $escape_markdown = false ]) : string|null
Parameters
$escape_markdown : bool = false
Return values
string|null

assignMemberVariables()

Helper to set member variables

protected assignMemberVariables(array<string|int, mixed> $data) : mixed
Parameters
$data : array<string|int, mixed>
Return values
mixed

makePrettyObjectArray()

Return an array of nice objects from an array of object arrays

protected makePrettyObjectArray(string $class, string $property) : array<string|int, mixed>

This method is used to generate pretty object arrays mainly for PhotoSize and Entities object arrays.

Parameters
$class : string
$property : string
Return values
array<string|int, mixed>

validate()

Perform any special entity validation

protected validate() : mixed
Tags
throws
TelegramException
Return values
mixed

Search results