class Discordrb::Events::PresenceEvent

Event raised when a user’s presence state updates (idle or online)

Attributes

client_status[R]

@return [Hash<Symbol, Symbol>] the current online status (‘:online`, `:idle` or `:dnd`) of the user

on various device types (`:desktop`, `:mobile`, or `:web`). The value will be `nil` if the user is offline or invisible.
server[R]

@return [Server] the server on which the presence update happened.

status[R]

@return [Symbol] the new status.

user[R]

@return [User] the user whose status got updated.

Public Class Methods

new(data, bot) click to toggle source
# File lib/discordrb/events/presence.rb, line 22
def initialize(data, bot)
  @bot = bot

  @user = bot.user(data['user']['id'].to_i)
  @status = data['status'].to_sym
  @client_status = user.client_status
  @server = bot.server(data['guild_id'].to_i)
end