Class: MijDiscord::Data::Recipient

Inherits:
User
  • Object
show all
Defined in:
lib/mij-discord/data/member.rb

Instance Attribute Summary collapse

Attributes inherited from User

#avatar_id, #bot, #bot_account, #discriminator, #game, #status, #stream_type, #stream_url, #username

Attributes included from IDObject

#id

Instance Method Summary collapse

Methods inherited from User

#avatar_url, #current_bot?, #distinct, #dnd?, #idle?, #invisible?, #member?, #mention, #offline?, #on, #online?, #pm, #send_file, #update_data, #update_presence, #webhook?

Methods included from IDObject

#==, #creation_time, #hash, synthesize

Constructor Details

#initialize(user, channel, bot) ⇒ Recipient

Returns a new instance of Recipient.

Raises:

  • (ArgumentError)


155
156
157
158
159
160
161
162
163
164
# File 'lib/mij-discord/data/member.rb', line 155

def initialize(user, channel, bot)
  @bot, @channel, @user = bot, channel, user
  raise ArgumentError, 'Recipient for public channel' unless channel.private?

  super @user

  @mute = @deaf = @self_mute = @self_deaf = false
  @voice_channel, @server, @roles = nil, nil, []
  @nickname, @joined_at = '', @channel.creation_time
end

Instance Attribute Details

#joined_atObject (readonly)

Returns the value of attribute joined_at.



146
147
148
# File 'lib/mij-discord/data/member.rb', line 146

def joined_at
  @joined_at
end

#nicknameObject (readonly) Also known as: nick

Returns the value of attribute nickname.



148
149
150
# File 'lib/mij-discord/data/member.rb', line 148

def nickname
  @nickname
end

#rolesObject (readonly)

Returns the value of attribute roles.



151
152
153
# File 'lib/mij-discord/data/member.rb', line 151

def roles
  @roles
end

#serverObject (readonly)

Returns the value of attribute server.



153
154
155
# File 'lib/mij-discord/data/member.rb', line 153

def server
  @server
end