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
698
699
700
|
# File 'lib/discordrb/data/interaction.rb', line 698
def attachments
@attachments
end
|
#author ⇒ User
Returns The user of the application.
695
696
697
|
# File 'lib/discordrb/data/interaction.rb', line 695
def author
@author
end
|
710
711
712
|
# File 'lib/discordrb/data/interaction.rb', line 710
def channel_id
@channel_id
end
|
#components ⇒ Array<Component>
716
717
718
|
# File 'lib/discordrb/data/interaction.rb', line 716
def components
@components
end
|
Returns The content of the message.
674
675
676
|
# File 'lib/discordrb/data/interaction.rb', line 674
def content
@content
end
|
#edited ⇒ true, false
689
690
691
|
# File 'lib/discordrb/data/interaction.rb', line 689
def edited
@edited
end
|
#edited_timestamp ⇒ Time?
686
687
688
|
# File 'lib/discordrb/data/interaction.rb', line 686
def edited_timestamp
@edited_timestamp
end
|
#embeds ⇒ Array<Embed>
701
702
703
|
# File 'lib/discordrb/data/interaction.rb', line 701
def embeds
@embeds
end
|
707
708
709
|
# File 'lib/discordrb/data/interaction.rb', line 707
def flags
@flags
end
|
692
693
694
|
# File 'lib/discordrb/data/interaction.rb', line 692
def id
@id
end
|
Returns The interaction that created this message.
671
672
673
|
# File 'lib/discordrb/data/interaction.rb', line 671
def interaction
@interaction
end
|
#mentions ⇒ Array<User>
704
705
706
|
# File 'lib/discordrb/data/interaction.rb', line 704
def mentions
@mentions
end
|
#message_reference ⇒ Hash?
713
714
715
|
# File 'lib/discordrb/data/interaction.rb', line 713
def message_reference
@message_reference
end
|
#pinned ⇒ true, false
Returns Whether this message is pinned in the channel it belongs to.
677
678
679
|
# File 'lib/discordrb/data/interaction.rb', line 677
def pinned
@pinned
end
|
#timestamp ⇒ Time
683
684
685
|
# File 'lib/discordrb/data/interaction.rb', line 683
def timestamp
@timestamp
end
|
#tts ⇒ true, false
680
681
682
|
# File 'lib/discordrb/data/interaction.rb', line 680
def tts
@tts
end
|
Instance Method Details
Returns The channel the interaction originates from.
773
774
775
|
# File 'lib/discordrb/data/interaction.rb', line 773
def channel
@bot.channel(@channel_id)
end
|
#delete ⇒ Object
785
786
787
|
# File 'lib/discordrb/data/interaction.rb', line 785
def delete
@interaction.delete_message(@id)
end
|
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil) {|builder| ... } ⇒ Object
Edit this message’s data.
794
795
796
|
# File 'lib/discordrb/data/interaction.rb', line 794
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.
761
762
763
|
# File 'lib/discordrb/data/interaction.rb', line 761
def member
server&.member(@user.id)
end
|
#respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil) {|builder| ... } ⇒ Object
780
781
782
|
# File 'lib/discordrb/data/interaction.rb', line 780
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.
767
768
769
|
# File 'lib/discordrb/data/interaction.rb', line 767
def server
@bot.server(@server_id)
end
|
#to_message ⇒ Discordrb::Message
Also known as:
message
799
800
801
|
# File 'lib/discordrb/data/interaction.rb', line 799
def to_message
Discordrb::Message.new(@data, @bot)
end
|