Class: GetChat

Inherits:
Chat
  • Object
show all
Defined in:
lib/objects/chat.rb

Overview

This object is returned only in get_chat methods

It extends from Chat class.

Instance Method Summary collapse

Methods inherited from Chat

#channel?, #has_title?, #id, #private?, #supergroup?, #title, #type, #username

Constructor Details

#initialize(chat) ⇒ GetChat

:nodoc:



80
81
82
# File 'lib/objects/chat.rb', line 80

def initialize(chat) # :nodoc:
  super(chat)
end

Instance Method Details

#can_set_sticker_set?Boolean

Optional. True, if the bot can change the group sticker set.

Returns:

  • (Boolean)


135
136
137
# File 'lib/objects/chat.rb', line 135

def can_set_sticker_set?
  @chat.can_set_sticker_set
end

#descriptionObject

Optional. Description, for groups, supergroups and channel chats.



94
95
96
# File 'lib/objects/chat.rb', line 94

def description
  @chat.description
end

#has_description?Boolean

Returns true if description is set to chat else false is returned.

Returns:

  • (Boolean)


145
146
147
# File 'lib/objects/chat.rb', line 145

def has_description?
  description.nil?
end

#has_photo?Boolean

Returns true if photo is set to chat else false is returned.

Returns:

  • (Boolean)


140
141
142
# File 'lib/objects/chat.rb', line 140

def has_photo?
  photo ? true : false
end

Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using export_chat_link.



101
102
103
# File 'lib/objects/chat.rb', line 101

def invite_link
  @chat.invite_link
end

#permissionsObject

Optional. Default chat member permissions, for groups and supergroups. Returns ChatPermissions object.



116
117
118
119
120
121
# File 'lib/objects/chat.rb', line 116

def permissions
  data = @chat.permissions
  return ChatPermissions.new(data) if data

  false
end

#photoObject

Optional. Returns ChatPhoto if available else false is returned.



85
86
87
88
89
90
# File 'lib/objects/chat.rb', line 85

def photo
  data = @chat.photo
  return ChatPhoto.new(data) if data

  false
end

#pinned_messageObject

Optional. Pinned message, for groups, supergroups and channels. Returns Message object.



107
108
109
110
111
112
# File 'lib/objects/chat.rb', line 107

def pinned_message
  data = @chat.pinned_message
  return Message.new(data) if data

  false
end

#pinned_message?Boolean

Returns true if message is pinned in chat else false is returned.

Returns:

  • (Boolean)


150
151
152
# File 'lib/objects/chat.rb', line 150

def pinned_message?
  pinned_message ? true : false
end

#slow_mode_delayObject

Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user.



125
126
127
# File 'lib/objects/chat.rb', line 125

def slow_mode_delay
  @chat.slow_mode_delay
end

#slow_mode_delay_set?Boolean

Returns true if slow mode delay is set in chat.

Returns:

  • (Boolean)


155
156
157
# File 'lib/objects/chat.rb', line 155

def slow_mode_delay_set?
  slow_mode_delay ? true : false
end

#sticker_set_nameObject

Optional. For supergroups, name of group sticker set.



130
131
132
# File 'lib/objects/chat.rb', line 130

def sticker_set_name
  @chat.sticker_set_name
end