Class: Discordrb::Events::PresenceEvent
- Inherits:
-
Object
- Object
- Discordrb::Events::PresenceEvent
- Defined in:
- lib/discordrb/events/presence.rb
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
-
#status ⇒ Object
readonly
Returns the value of attribute status.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize(data, bot) ⇒ PresenceEvent
constructor
A new instance of PresenceEvent.
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
#server ⇒ Object (readonly)
Returns the value of attribute server.
6 7 8 |
# File 'lib/discordrb/events/presence.rb', line 6 def server @server end |
#status ⇒ Object (readonly)
Returns the value of attribute status.
6 7 8 |
# File 'lib/discordrb/events/presence.rb', line 6 def status @status end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/discordrb/events/presence.rb', line 6 def user @user end |