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
678
679
680
|
# File 'lib/discordrb/data/interaction.rb', line 678
def attachments
@attachments
end
|
#author ⇒ User
Returns The user of the application.
675
676
677
|
# File 'lib/discordrb/data/interaction.rb', line 675
def author
@author
end
|
690
691
692
|
# File 'lib/discordrb/data/interaction.rb', line 690
def channel_id
@channel_id
end
|
#components ⇒ Array<Component>
696
697
698
|
# File 'lib/discordrb/data/interaction.rb', line 696
def components
@components
end
|
Returns The content of the message.
654
655
656
|
# File 'lib/discordrb/data/interaction.rb', line 654
def content
@content
end
|
#edited ⇒ true, false
669
670
671
|
# File 'lib/discordrb/data/interaction.rb', line 669
def edited
@edited
end
|
#edited_timestamp ⇒ Time?
666
667
668
|
# File 'lib/discordrb/data/interaction.rb', line 666
def edited_timestamp
@edited_timestamp
end
|
#embeds ⇒ Array<Embed>
681
682
683
|
# File 'lib/discordrb/data/interaction.rb', line 681
def embeds
@embeds
end
|
687
688
689
|
# File 'lib/discordrb/data/interaction.rb', line 687
def flags
@flags
end
|
672
673
674
|
# File 'lib/discordrb/data/interaction.rb', line 672
def id
@id
end
|
Returns The interaction that created this message.
651
652
653
|
# File 'lib/discordrb/data/interaction.rb', line 651
def interaction
@interaction
end
|
#mentions ⇒ Array<User>
684
685
686
|
# File 'lib/discordrb/data/interaction.rb', line 684
def mentions
@mentions
end
|
#message_reference ⇒ Hash?
693
694
695
|
# File 'lib/discordrb/data/interaction.rb', line 693
def message_reference
@message_reference
end
|
#pinned ⇒ true, false
Returns Whether this message is pinned in the channel it belongs to.
657
658
659
|
# File 'lib/discordrb/data/interaction.rb', line 657
def pinned
@pinned
end
|
#timestamp ⇒ Time
663
664
665
|
# File 'lib/discordrb/data/interaction.rb', line 663
def timestamp
@timestamp
end
|
#tts ⇒ true, false
660
661
662
|
# File 'lib/discordrb/data/interaction.rb', line 660
def tts
@tts
end
|
Instance Method Details
Returns The channel the interaction originates from.
753
754
755
|
# File 'lib/discordrb/data/interaction.rb', line 753
def channel
@bot.channel(@channel_id)
end
|
#delete ⇒ Object
765
766
767
|
# File 'lib/discordrb/data/interaction.rb', line 765
def delete
@interaction.delete_message(@id)
end
|
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil) {|builder| ... } ⇒ Object
Edit this message's data.
774
775
776
|
# File 'lib/discordrb/data/interaction.rb', line 774
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.
741
742
743
|
# File 'lib/discordrb/data/interaction.rb', line 741
def member
server&.member(@user.id)
end
|
#respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil) {|builder| ... } ⇒ Object
760
761
762
|
# File 'lib/discordrb/data/interaction.rb', line 760
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.
747
748
749
|
# File 'lib/discordrb/data/interaction.rb', line 747
def server
@bot.server(@server_id)
end
|
#to_message ⇒ Discordrb::Message
Also known as:
message
779
780
781
|
# File 'lib/discordrb/data/interaction.rb', line 779
def to_message
Discordrb::Message.new(@data, @bot)
end
|