Skip to content

class Tourmaline::Chat
inherits Reference #

This object represents a chat.

Included modules

JSON::Serializable

Constructors#

.new(id, type, title : String? = nil, username : String? = nil, first_name : String? = nil, last_name : String? = nil, is_forum : Bool? = nil, photo : Tourmaline::ChatPhoto? = nil, active_usernames : Array(String) = [] of String, available_reactions : Array(Tourmaline::ReactionType) = [] of Tourmaline::ReactionType, accent_color_id : Int32 | Int64 | Nil = nil, background_custom_emoji_id : String? = nil, profile_accent_color_id : Int32 | Int64 | Nil = nil, profile_background_custom_emoji_id : String? = nil, emoji_status_custom_emoji_id : String? = nil, emoji_status_expiration_date : Int32 | Int64 | Nil = nil, bio : String? = nil, has_private_forwards : Bool? = nil, has_restricted_voice_and_video_messages : Bool? = nil, join_to_send_messages : Bool? = nil, join_by_request : Bool? = nil, description : String? = nil, invite_link : String? = nil, pinned_message : Tourmaline::Message? = nil, permissions : Tourmaline::ChatPermissions? = nil, slow_mode_delay : Int32 | Int64 | Nil = nil, message_auto_delete_time : Int32 | Int64 | Nil = nil, has_aggressive_anti_spam_enabled : Bool? = nil, has_hidden_members : Bool? = nil, has_protected_content : Bool? = nil, has_visible_history : Bool? = nil, sticker_set_name : String? = nil, can_set_sticker_set : Bool? = nil, linked_chat_id : Int32 | Int64 | Nil = nil, location : Tourmaline::ChatLocation? = nil) #

View source

.new(pull : JSON::PullParser) #

View source

Methods#

#accent_color_id : Int32 | Int64 | Nil #

Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.

View source

#accent_color_id=(accent_color_id : Int32 | Int64 | Nil) #

Optional. Identifier of the accent color for the chat name and backgrounds of the chat photo, reply header, and link preview. See accent colors for more details. Returned only in getChat. Always returned in getChat.

View source

#active_usernames : Array(String) #

Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.

View source

#active_usernames=(active_usernames : Array(String)) #

Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in getChat.

View source

#available_reactions : Array(Tourmaline::ReactionType) #

Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.

View source

#available_reactions=(available_reactions : Array(Tourmaline::ReactionType)) #

Optional. List of available reactions allowed in the chat. If omitted, then all emoji reactions are allowed. Returned only in getChat.

View source

#background_custom_emoji_id : String? #

Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.

View source

#background_custom_emoji_id=(background_custom_emoji_id : String?) #

Optional. Custom emoji identifier of emoji chosen by the chat for the reply header and link preview background. Returned only in getChat.

View source

#bio : String? #

Optional. Bio of the other party in a private chat. Returned only in getChat.

View source

#bio=(bio : String?) #

Optional. Bio of the other party in a private chat. Returned only in getChat.

View source

#can_set_sticker_set=(can_set_sticker_set : Bool?) #

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

View source

#can_set_sticker_set? : Bool? #

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

View source

#channel? #

View source

#description : String? #

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

View source

#description=(description : String?) #

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

View source

#emoji_status_custom_emoji_id : String? #

Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.

View source

#emoji_status_custom_emoji_id=(emoji_status_custom_emoji_id : String?) #

Optional. Custom emoji identifier of the emoji status of the chat or the other party in a private chat. Returned only in getChat.

View source

#emoji_status_expiration_date : Time? #

View source

#emoji_status_expiration_date=(emoji_status_expiration_date : Time?) #

View source

#first_name : String? #

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

View source

#first_name=(first_name : String?) #

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

View source

#group? #

View source

#has_aggressive_anti_spam_enabled=(has_aggressive_anti_spam_enabled : Bool?) #

Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.

View source

#has_aggressive_anti_spam_enabled? : Bool? #

Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in getChat.

View source

#has_hidden_members=(has_hidden_members : Bool?) #

Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.

View source

#has_hidden_members? : Bool? #

Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in getChat.

View source

#has_private_forwards=(has_private_forwards : Bool?) #

Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.

View source

#has_private_forwards? : Bool? #

Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in getChat.

View source

#has_protected_content=(has_protected_content : Bool?) #

Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.

View source

#has_protected_content? : Bool? #

Optional. True, if messages from the chat can't be forwarded to other chats. Returned only in getChat.

View source

#has_restricted_voice_and_video_messages=(has_restricted_voice_and_video_messages : Bool?) #

Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.

View source

#has_restricted_voice_and_video_messages? : Bool? #

Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in getChat.

View source

#has_visible_history=(has_visible_history : Bool?) #

Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.

View source

#has_visible_history? : Bool? #

Optional. True, if new chat members will have access to old messages; available only to chat administrators. Returned only in getChat.

View source

#id : Int32 | Int64 #

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

View source

#id=(id : Int32 | Int64) #

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

View source

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

View source

#invite_link=(invite_link : String?) #

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

View source

#is_forum=(is_forum : Bool?) #

Optional. True, if the supergroup chat is a forum (has topics enabled)

View source

#is_forum? : Bool? #

Optional. True, if the supergroup chat is a forum (has topics enabled)

View source

#join_by_request=(join_by_request : Bool?) #

Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.

View source

#join_by_request? : Bool? #

Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in getChat.

View source

#join_to_send_messages=(join_to_send_messages : Bool?) #

Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.

View source

#join_to_send_messages? : Bool? #

Optional. True, if users need to join the supergroup before they can send messages. Returned only in getChat.

View source

#last_name : String? #

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

View source

#last_name=(last_name : String?) #

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

View source

#linked_chat_id : Int32 | Int64 | Nil #

Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.

View source

#linked_chat_id=(linked_chat_id : Int32 | Int64 | Nil) #

Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in getChat.

View source

#location : Tourmaline::ChatLocation? #

Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.

View source

#location=(location : Tourmaline::ChatLocation?) #

Optional. For supergroups, the location to which the supergroup is connected. Returned only in getChat.

View source

#message_auto_delete_time : Time? #

View source

#message_auto_delete_time=(message_auto_delete_time : Time?) #

View source

#name #

View source

#permissions : Tourmaline::ChatPermissions? #

Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.

View source

#permissions=(permissions : Tourmaline::ChatPermissions?) #

Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat.

View source

#photo : Tourmaline::ChatPhoto? #

Optional. Chat photo. Returned only in getChat.

View source

#photo=(photo : Tourmaline::ChatPhoto?) #

Optional. Chat photo. Returned only in getChat.

View source

#pinned_message : Tourmaline::Message? #

Optional. The most recent pinned message (by sending date). Returned only in getChat.

View source

#pinned_message=(pinned_message : Tourmaline::Message?) #

Optional. The most recent pinned message (by sending date). Returned only in getChat.

View source

#private? #

View source

#profile_accent_color_id : Int32 | Int64 | Nil #

Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.

View source

#profile_accent_color_id=(profile_accent_color_id : Int32 | Int64 | Nil) #

Optional. Identifier of the accent color for the chat's profile background. See profile accent colors for more details. Returned only in getChat.

View source

#profile_background_custom_emoji_id : String? #

Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.

View source

#profile_background_custom_emoji_id=(profile_background_custom_emoji_id : String?) #

Optional. Custom emoji identifier of the emoji chosen by the chat for its profile background. Returned only in getChat.

View source

#slow_mode_delay : Int32 | Int64 | Nil #

Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.

View source

#slow_mode_delay=(slow_mode_delay : Int32 | Int64 | Nil) #

Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user; in seconds. Returned only in getChat.

View source

#sticker_set_name : String? #

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

View source

#sticker_set_name=(sticker_set_name : String?) #

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

View source

#supergroup? #

View source

#title : String? #

Optional. Title, for supergroups, channels and group chats

View source

#title=(title : String?) #

Optional. Title, for supergroups, channels and group chats

View source

#type : String #

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

View source

#type=(type : String) #

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

View source

#username : String? #

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

View source

#username=(username : String?) #

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

View source