Class: OnyxCord::Events::PlayingEvent
- Defined in:
- lib/onyxcord/events/presence/playing.rb
Overview
Event raised when a user starts or stops playing a game
Instance Attribute Summary collapse
-
#activity ⇒ OnyxCord::Activity
readonly
The new activity.
-
#client_status ⇒ Hash<Symbol, Symbol>
readonly
The current online status (
:online,:idleor:dnd) of the user on various device types (:desktop,:mobile, or:web). -
#details ⇒ String
readonly
What the player is currently doing (ex. game being streamed).
-
#server ⇒ Server
readonly
The server on which the presence update happened.
-
#type ⇒ Integer
readonly
The type of play.
-
#url ⇒ String
readonly
The URL to the stream.
-
#user ⇒ User
readonly
The user whose status got updated.
Attributes inherited from Event
Instance Method Summary collapse
-
#game ⇒ String
The name of the new game the user is playing.
Instance Attribute Details
#activity ⇒ OnyxCord::Activity (readonly)
Returns The new activity.
16 17 18 |
# File 'lib/onyxcord/events/presence/playing.rb', line 16 def activity @activity end |
#client_status ⇒ Hash<Symbol, Symbol> (readonly)
Returns 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.
30 31 32 |
# File 'lib/onyxcord/events/presence/playing.rb', line 30 def client_status @client_status end |
#details ⇒ String (readonly)
Returns what the player is currently doing (ex. game being streamed).
|
|
# File 'lib/onyxcord/events/presence/playing.rb', line 21
|
#server ⇒ Server (readonly)
Returns the server on which the presence update happened.
10 11 12 |
# File 'lib/onyxcord/events/presence/playing.rb', line 10 def server @server end |
#type ⇒ Integer (readonly)
Returns the type of play. See Activity.
26 |
# File 'lib/onyxcord/events/presence/playing.rb', line 26 delegate :url, :details, :type, to: :activity |
#url ⇒ String (readonly)
Returns the URL to the stream.
|
|
# File 'lib/onyxcord/events/presence/playing.rb', line 18
|
#user ⇒ User (readonly)
Returns the user whose status got updated.
13 14 15 |
# File 'lib/onyxcord/events/presence/playing.rb', line 13 def user @user end |
Instance Method Details
#game ⇒ String
Returns the name of the new game the user is playing.
43 44 45 |
# File 'lib/onyxcord/events/presence/playing.rb', line 43 def game @activity.name end |