Class: DiscordRDA::MessageUpdateEvent
- Inherits:
-
Event
- Object
- Event
- DiscordRDA::MessageUpdateEvent
show all
- Defined in:
- lib/discord_rda/event/base.rb
Overview
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
Returns a new instance of MessageUpdateEvent.
456
457
458
|
# File 'lib/discord_rda/event/base.rb', line 456
def initialize(data, shard_id:)
super('MESSAGE_UPDATE', data, shard_id: shard_id)
end
|
Instance Method Details
#attachments ⇒ Object
501
502
503
|
# File 'lib/discord_rda/event/base.rb', line 501
def attachments
@data['attachments'] || []
end
|
#attachments_changed? ⇒ Boolean
537
538
539
|
# File 'lib/discord_rda/event/base.rb', line 537
def attachments_changed?
@data.key?('attachments')
end
|
#author ⇒ Object
484
485
486
|
# File 'lib/discord_rda/event/base.rb', line 484
def author
@author ||= User.new(@data['author']) if @data['author']
end
|
#changed_fields ⇒ Object
525
526
527
|
# File 'lib/discord_rda/event/base.rb', line 525
def changed_fields
@data.keys - %w[id channel_id guild_id]
end
|
#channel_id ⇒ Object
468
469
470
|
# File 'lib/discord_rda/event/base.rb', line 468
def channel_id
@data['channel_id']
end
|
#components ⇒ Object
505
506
507
|
# File 'lib/discord_rda/event/base.rb', line 505
def components
@data['components'] || []
end
|
#components_changed? ⇒ Boolean
541
542
543
|
# File 'lib/discord_rda/event/base.rb', line 541
def components_changed?
@data.key?('components')
end
|
#content ⇒ Object
493
494
495
|
# File 'lib/discord_rda/event/base.rb', line 493
def content
@data['content']
end
|
#content_changed? ⇒ Boolean
529
530
531
|
# File 'lib/discord_rda/event/base.rb', line 529
def content_changed?
@data.key?('content')
end
|
#edited? ⇒ Boolean
476
477
478
|
# File 'lib/discord_rda/event/base.rb', line 476
def edited?
true
end
|
#edited_timestamp ⇒ Object
480
481
482
|
# File 'lib/discord_rda/event/base.rb', line 480
def edited_timestamp
@data['edited_timestamp']
end
|
#embeds ⇒ Object
497
498
499
|
# File 'lib/discord_rda/event/base.rb', line 497
def embeds
@data['embeds'] || []
end
|
#embeds_changed? ⇒ Boolean
533
534
535
|
# File 'lib/discord_rda/event/base.rb', line 533
def embeds_changed?
@data.key?('embeds')
end
|
#flags ⇒ Object
521
522
523
|
# File 'lib/discord_rda/event/base.rb', line 521
def flags
@data['flags']
end
|
#guild_id ⇒ Object
472
473
474
|
# File 'lib/discord_rda/event/base.rb', line 472
def guild_id
@data['guild_id']
end
|
#id ⇒ Object
464
465
466
|
# File 'lib/discord_rda/event/base.rb', line 464
def id
@data['id']
end
|
#member ⇒ Object
488
489
490
491
|
# File 'lib/discord_rda/event/base.rb', line 488
def member
return nil unless @data['member']
@member ||= Member.new(@data['author'].merge('member' => @data['member'], 'guild_id' => guild_id))
end
|
#mention_roles ⇒ Object
513
514
515
|
# File 'lib/discord_rda/event/base.rb', line 513
def mention_roles
@data['mention_roles'] || []
end
|
#mentions ⇒ Object
509
510
511
|
# File 'lib/discord_rda/event/base.rb', line 509
def mentions
@data['mentions'] || []
end
|
#message ⇒ Object
460
461
462
|
# File 'lib/discord_rda/event/base.rb', line 460
def message
@message ||= Message.new(@data)
end
|
#pinned ⇒ Object
517
518
519
|
# File 'lib/discord_rda/event/base.rb', line 517
def pinned
@data['pinned']
end
|