Class: Discordrb::MessageActivity
- Inherits:
-
Object
- Object
- Discordrb::MessageActivity
- Defined in:
- lib/discordrb/data/message_activity.rb
Overview
A rich-presence activity attached to a message.
Constant Summary collapse
- TYPES =
Map of activity types.
{ join: 1, spectate: 2, listen: 3, join_request: 5 }.freeze
Instance Attribute Summary collapse
-
#party_id ⇒ String?
readonly
The party ID of the activity.
-
#type ⇒ Integer
readonly
The type of the activity.
Instance Method Summary collapse
-
#join? ⇒ true, false
Whether or not the activity type is join.
-
#join_request? ⇒ true, false
Whether or not the activity type is a join request.
-
#listen? ⇒ true, false
Whether or not the activity type is listen.
-
#spectate? ⇒ true, false
Whether or not the activity type is spectate.
Instance Attribute Details
#party_id ⇒ String? (readonly)
Returns the party ID of the activity.
18 19 20 |
# File 'lib/discordrb/data/message_activity.rb', line 18 def party_id @party_id end |
#type ⇒ Integer (readonly)
Returns the type of the activity.
15 16 17 |
# File 'lib/discordrb/data/message_activity.rb', line 15 def type @type end |
Instance Method Details
#join? ⇒ true, false
Returns whether or not the activity type is join.
35 36 37 38 39 |
# File 'lib/discordrb/data/message_activity.rb', line 35 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#join_request? ⇒ true, false
Returns whether or not the activity type is a join request.
35 36 37 38 39 |
# File 'lib/discordrb/data/message_activity.rb', line 35 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#listen? ⇒ true, false
Returns whether or not the activity type is listen.
35 36 37 38 39 |
# File 'lib/discordrb/data/message_activity.rb', line 35 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |
#spectate? ⇒ true, false
Returns whether or not the activity type is spectate.
35 36 37 38 39 |
# File 'lib/discordrb/data/message_activity.rb', line 35 TYPES.each do |name, value| define_method("#{name}?") do @type == value end end |