Class: Discordrb::Events::PresenceEvent

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

Overview

Event raised when a user’s presence state updates (playing game, idle or back online)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(data, bot) ⇒ PresenceEvent

Returns a new instance of PresenceEvent.



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

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.



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

def server
  @server
end

#statusObject (readonly)

Returns the value of attribute status.



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

def status
  @status
end

#userObject (readonly)

Returns the value of attribute user.



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

def user
  @user
end