Class: DiscordRDA::MessageReactionRemoveAllEvent

Inherits:
Event
  • Object
show all
Defined in:
lib/discord_rda/event/base.rb

Instance Attribute Summary

Attributes inherited from Event

#data, #shard_id, #timestamp, #type

Instance Method Summary collapse

Methods inherited from Event

#created_at, #inspect, #to_h

Constructor Details

#initialize(data, shard_id:) ⇒ MessageReactionRemoveAllEvent

Returns a new instance of MessageReactionRemoveAllEvent.



781
782
783
# File 'lib/discord_rda/event/base.rb', line 781

def initialize(data, shard_id:)
  super('MESSAGE_REACTION_REMOVE_ALL', data, shard_id: shard_id)
end

Instance Method Details

#channel_idObject



789
790
791
# File 'lib/discord_rda/event/base.rb', line 789

def channel_id
  @data['channel_id']
end

#dm?Boolean

Returns:

  • (Boolean)


801
802
803
# File 'lib/discord_rda/event/base.rb', line 801

def dm?
  guild_id.nil?
end

#guild?Boolean

Returns:

  • (Boolean)


797
798
799
# File 'lib/discord_rda/event/base.rb', line 797

def guild?
  !guild_id.nil?
end

#guild_idObject



793
794
795
# File 'lib/discord_rda/event/base.rb', line 793

def guild_id
  @data['guild_id']
end

#jump_urlObject



805
806
807
808
809
810
811
# File 'lib/discord_rda/event/base.rb', line 805

def jump_url
  if guild_id
    "https://discord.com/channels/#{guild_id}/#{channel_id}/#{message_id}"
  else
    "https://discord.com/channels/@me/#{channel_id}/#{message_id}"
  end
end

#message_idObject



785
786
787
# File 'lib/discord_rda/event/base.rb', line 785

def message_id
  @data['message_id']
end