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, #extra, #game, #status, #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, process_avatar, #send_file, #update_data, #update_presence, #webhook?

Methods included from IDObject

#==, #creation_time, #hash, synthesize, timestamp

Constructor Details

#initialize(user, channel, bot) ⇒ Recipient

Returns a new instance of Recipient.

Raises:

  • (ArgumentError)


159
160
161
162
163
164
165
166
167
168
# File 'lib/mij-discord/data/member.rb', line 159

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.



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

def joined_at
  @joined_at
end

#nicknameObject (readonly) Also known as: nick

Returns the value of attribute nickname.



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

def nickname
  @nickname
end

#rolesObject (readonly)

Returns the value of attribute roles.



155
156
157
# File 'lib/mij-discord/data/member.rb', line 155

def roles
  @roles
end

#serverObject (readonly)

Returns the value of attribute server.



157
158
159
# File 'lib/mij-discord/data/member.rb', line 157

def server
  @server
end

Instance Method Details

#inspectObject



170
171
172
# File 'lib/mij-discord/data/member.rb', line 170

def inspect
  MijDiscord.make_inspect(self, :user, :joined_at)
end