Class: DiscordRDA::Webhook

Inherits:
Entity
  • Object
show all
Defined in:
lib/discord_rda/entity/support.rb

Constant Summary collapse

TYPES =
{
  incoming: 1,
  channel_follower: 2,
  application: 3
}.freeze

Instance Attribute Summary

Attributes inherited from Entity

#id

Instance Method Summary collapse

Methods inherited from Entity

#==, attribute, #created_at, from_hash, #hash, #initialize, #inspect, #to_h, #to_json

Constructor Details

This class inherits a constructor from DiscordRDA::Entity

Instance Method Details

#application?Boolean

Returns:

  • (Boolean)


446
447
448
# File 'lib/discord_rda/entity/support.rb', line 446

def application?
  type == 3
end

#channel_follower?Boolean

Returns:

  • (Boolean)


442
443
444
# File 'lib/discord_rda/entity/support.rb', line 442

def channel_follower?
  type == 2
end

#incoming?Boolean

Returns:

  • (Boolean)


438
439
440
# File 'lib/discord_rda/entity/support.rb', line 438

def incoming?
  type == 1
end

#source_channelObject



434
435
436
# File 'lib/discord_rda/entity/support.rb', line 434

def source_channel
  @raw_data['source_channel'] ? Channel.new(@raw_data['source_channel']) : nil
end

#source_guildObject



430
431
432
# File 'lib/discord_rda/entity/support.rb', line 430

def source_guild
  @raw_data['source_guild'] ? Guild.new(@raw_data['source_guild']) : nil
end

#userObject



426
427
428
# File 'lib/discord_rda/entity/support.rb', line 426

def user
  @raw_data['user'] ? User.new(@raw_data['user']) : nil
end