Class: Discordrb::Interactions::Message
- Inherits:
-
Object
- Object
- Discordrb::Interactions::Message
show all
- Includes:
- Discordrb::IDObject
- Defined in:
- lib/discordrb/data/interaction.rb
Overview
A message partial for interactions.
Instance Attribute Summary collapse
Instance Method Summary
collapse
#==, #creation_time, synthesise
Instance Attribute Details
687
688
689
|
# File 'lib/discordrb/data/interaction.rb', line 687
def attachments
@attachments
end
|
#author ⇒ User
Returns The user of the application.
684
685
686
|
# File 'lib/discordrb/data/interaction.rb', line 684
def author
@author
end
|
699
700
701
|
# File 'lib/discordrb/data/interaction.rb', line 699
def channel_id
@channel_id
end
|
#components ⇒ Array<Component>
705
706
707
|
# File 'lib/discordrb/data/interaction.rb', line 705
def components
@components
end
|
Returns The content of the message.
663
664
665
|
# File 'lib/discordrb/data/interaction.rb', line 663
def content
@content
end
|
#edited ⇒ true, false
678
679
680
|
# File 'lib/discordrb/data/interaction.rb', line 678
def edited
@edited
end
|
#edited_timestamp ⇒ Time?
675
676
677
|
# File 'lib/discordrb/data/interaction.rb', line 675
def edited_timestamp
@edited_timestamp
end
|
#embeds ⇒ Array<Embed>
690
691
692
|
# File 'lib/discordrb/data/interaction.rb', line 690
def embeds
@embeds
end
|
696
697
698
|
# File 'lib/discordrb/data/interaction.rb', line 696
def flags
@flags
end
|
681
682
683
|
# File 'lib/discordrb/data/interaction.rb', line 681
def id
@id
end
|
Returns The interaction that created this message.
660
661
662
|
# File 'lib/discordrb/data/interaction.rb', line 660
def interaction
@interaction
end
|
#mentions ⇒ Array<User>
693
694
695
|
# File 'lib/discordrb/data/interaction.rb', line 693
def mentions
@mentions
end
|
#message_reference ⇒ Hash?
702
703
704
|
# File 'lib/discordrb/data/interaction.rb', line 702
def message_reference
@message_reference
end
|
#pinned ⇒ true, false
Returns Whether this message is pinned in the channel it belongs to.
666
667
668
|
# File 'lib/discordrb/data/interaction.rb', line 666
def pinned
@pinned
end
|
#timestamp ⇒ Time
672
673
674
|
# File 'lib/discordrb/data/interaction.rb', line 672
def timestamp
@timestamp
end
|
#tts ⇒ true, false
669
670
671
|
# File 'lib/discordrb/data/interaction.rb', line 669
def tts
@tts
end
|
Instance Method Details
Returns The channel the interaction originates from.
762
763
764
|
# File 'lib/discordrb/data/interaction.rb', line 762
def channel
@bot.channel(@channel_id)
end
|
#delete ⇒ Object
774
775
776
|
# File 'lib/discordrb/data/interaction.rb', line 774
def delete
@interaction.delete_message(@id)
end
|
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil) {|builder| ... } ⇒ Object
Edit this message's data.
783
784
785
|
# File 'lib/discordrb/data/interaction.rb', line 783
def edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, &block)
@interaction.edit_message(@id, content: content, embeds: embeds, allowed_mentions: allowed_mentions, components: components, &block)
end
|
Returns This will return nil if the bot does not have access to the
server the interaction originated in.
750
751
752
|
# File 'lib/discordrb/data/interaction.rb', line 750
def member
server&.member(@user.id)
end
|
#respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil) {|builder| ... } ⇒ Object
769
770
771
|
# File 'lib/discordrb/data/interaction.rb', line 769
def respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil, &block)
@interaction.send_message(content: content, embeds: embeds, allowed_mentions: allowed_mentions, flags: flags, ephemeral: ephemeral, components: components, &block)
end
|
Returns This will return nil if the bot does not have access to the
server the interaction originated in.
756
757
758
|
# File 'lib/discordrb/data/interaction.rb', line 756
def server
@bot.server(@server_id)
end
|
#to_message ⇒ Discordrb::Message
Also known as:
message
788
789
790
|
# File 'lib/discordrb/data/interaction.rb', line 788
def to_message
Discordrb::Message.new(@data, @bot)
end
|