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.
461
462
463
|
# File 'lib/discord_rda/event/base.rb', line 461
def initialize(data, shard_id:)
super('MESSAGE_UPDATE', data, shard_id: shard_id)
end
|
Instance Method Details
#attachments ⇒ Object
506
507
508
|
# File 'lib/discord_rda/event/base.rb', line 506
def attachments
@data['attachments'] || []
end
|
#attachments_changed? ⇒ Boolean
542
543
544
|
# File 'lib/discord_rda/event/base.rb', line 542
def attachments_changed?
@data.key?('attachments')
end
|
#author ⇒ Object
489
490
491
|
# File 'lib/discord_rda/event/base.rb', line 489
def author
@author ||= User.new(@data['author']) if @data['author']
end
|
#changed_fields ⇒ Object
530
531
532
|
# File 'lib/discord_rda/event/base.rb', line 530
def changed_fields
@data.keys - %w[id channel_id guild_id]
end
|
#channel_id ⇒ Object
473
474
475
|
# File 'lib/discord_rda/event/base.rb', line 473
def channel_id
@data['channel_id']
end
|
#components ⇒ Object
510
511
512
|
# File 'lib/discord_rda/event/base.rb', line 510
def components
@data['components'] || []
end
|
#components_changed? ⇒ Boolean
546
547
548
|
# File 'lib/discord_rda/event/base.rb', line 546
def components_changed?
@data.key?('components')
end
|
#content ⇒ Object
498
499
500
|
# File 'lib/discord_rda/event/base.rb', line 498
def content
@data['content']
end
|
#content_changed? ⇒ Boolean
534
535
536
|
# File 'lib/discord_rda/event/base.rb', line 534
def content_changed?
@data.key?('content')
end
|
#edited? ⇒ Boolean
481
482
483
|
# File 'lib/discord_rda/event/base.rb', line 481
def edited?
true
end
|
#edited_timestamp ⇒ Object
485
486
487
|
# File 'lib/discord_rda/event/base.rb', line 485
def edited_timestamp
@data['edited_timestamp']
end
|
#embeds ⇒ Object
502
503
504
|
# File 'lib/discord_rda/event/base.rb', line 502
def embeds
@data['embeds'] || []
end
|
#embeds_changed? ⇒ Boolean
538
539
540
|
# File 'lib/discord_rda/event/base.rb', line 538
def embeds_changed?
@data.key?('embeds')
end
|
#flags ⇒ Object
526
527
528
|
# File 'lib/discord_rda/event/base.rb', line 526
def flags
@data['flags']
end
|
#guild_id ⇒ Object
477
478
479
|
# File 'lib/discord_rda/event/base.rb', line 477
def guild_id
@data['guild_id']
end
|
#id ⇒ Object
469
470
471
|
# File 'lib/discord_rda/event/base.rb', line 469
def id
@data['id']
end
|
#member ⇒ Object
493
494
495
496
|
# File 'lib/discord_rda/event/base.rb', line 493
def member
return nil unless @data['member']
@member ||= Member.new(@data['author'].merge('member' => @data['member'], 'guild_id' => guild_id))
end
|
#mention_roles ⇒ Object
518
519
520
|
# File 'lib/discord_rda/event/base.rb', line 518
def mention_roles
@data['mention_roles'] || []
end
|
#mentions ⇒ Object
514
515
516
|
# File 'lib/discord_rda/event/base.rb', line 514
def mentions
@data['mentions'] || []
end
|
#message ⇒ Object
465
466
467
|
# File 'lib/discord_rda/event/base.rb', line 465
def message
@message ||= Message.new(@data)
end
|
#pinned ⇒ Object
522
523
524
|
# File 'lib/discord_rda/event/base.rb', line 522
def pinned
@data['pinned']
end
|