Class: Discordrb::Events::PresenceEvent

Inherits:
Object
  • Object
show all
Defined in:
lib/discordrb/events/presence.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ PresenceEvent

Returns a new instance of PresenceEvent.



8
9
10
11
12
# File 'lib/discordrb/events/presence.rb', line 8

def initialize(data, bot)
  @user = Discordrb::User.new(data['user'], bot)
  @status = data['status'].to_sym
  @server = bot.server(data['guild_id'])
end

Instance Attribute Details

#serverObject (readonly)

Returns the value of attribute server.



6
7
8
# File 'lib/discordrb/events/presence.rb', line 6

def server
  @server
end

#statusObject (readonly)

Returns the value of attribute status.



6
7
8
# File 'lib/discordrb/events/presence.rb', line 6

def status
  @status
end

#userObject (readonly)

Returns the value of attribute user.



6
7
8
# File 'lib/discordrb/events/presence.rb', line 6

def user
  @user
end