Class: User

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

Overview

Monday, August 24 2020 EAT

This object represents a Telegram user.

Direct Known Subclasses

BotUser

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ User

:nodoc:



8
9
10
# File 'lib/objects/user.rb', line 8

def initialize(user) # :nodoc:
  @user = user
end

Instance Method Details

#bot?Boolean

True, if this user is a bot.

Returns:

  • (Boolean)


18
19
20
# File 'lib/objects/user.rb', line 18

def bot?
  @user.is_bot
end

#first_nameObject

User’s or bot’s first name.



23
24
25
# File 'lib/objects/user.rb', line 23

def first_name
  @user.first_name
end

#idObject

Unique identifier for this user or bot.



13
14
15
# File 'lib/objects/user.rb', line 13

def id
  @user.id
end

#language_codeObject

Optional. IETF language tag of the user’s language.



40
41
42
# File 'lib/objects/user.rb', line 40

def language_code
  @user.language_code
end

#last_nameObject

Optional. User ‘s or BotUser ’s last name.



28
29
30
# File 'lib/objects/user.rb', line 28

def last_name
  @user.last_name
end

#usernameObject

Optional. User’s or bot’s username



33
34
35
# File 'lib/objects/user.rb', line 33

def username
  @user.username
end