Class: Discordrb::Interactions::Message
- Inherits:
-
Object
- Object
- Discordrb::Interactions::Message
- Includes:
- Discordrb::IDObject
- Defined in:
- lib/discordrb/data/interaction.rb
Overview
A message partial for interactions.
Instance Attribute Summary collapse
- #attachments ⇒ Attachment readonly
-
#author ⇒ User
readonly
The user of the application.
- #channel_id ⇒ Integer readonly
- #components ⇒ Array<Component> readonly
-
#content ⇒ String?
readonly
The content of the message.
- #edited ⇒ true, false readonly
- #edited_timestamp ⇒ Time? readonly
- #embeds ⇒ Array<Embed> readonly
- #flags ⇒ Integer readonly
- #id ⇒ Integer readonly
-
#interaction ⇒ Interaction
readonly
The interaction that created this message.
- #mentions ⇒ Array<User> readonly
- #message_reference ⇒ Hash? readonly
-
#pinned ⇒ true, false
readonly
Whether this message is pinned in the channel it belongs to.
- #timestamp ⇒ Time readonly
- #tts ⇒ true, false readonly
Instance Method Summary collapse
-
#channel ⇒ Channel
The channel the interaction originates from.
-
#delete ⇒ Object
Delete this message.
-
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Edit this message's data.
-
#member ⇒ Member?
This will return nil if the bot does not have access to the server the interaction originated in.
-
#respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Respond to this message.
-
#server ⇒ Server?
This will return nil if the bot does not have access to the server the interaction originated in.
- #to_message ⇒ Discordrb::Message (also: #message)
Methods included from Discordrb::IDObject
#==, #creation_time, synthesise
Instance Attribute Details
#attachments ⇒ Attachment (readonly)
824 825 826 |
# File 'lib/discordrb/data/interaction.rb', line 824 def @attachments end |
#author ⇒ User (readonly)
Returns The user of the application.
821 822 823 |
# File 'lib/discordrb/data/interaction.rb', line 821 def @author end |
#channel_id ⇒ Integer (readonly)
836 837 838 |
# File 'lib/discordrb/data/interaction.rb', line 836 def channel_id @channel_id end |
#components ⇒ Array<Component> (readonly)
842 843 844 |
# File 'lib/discordrb/data/interaction.rb', line 842 def components @components end |
#content ⇒ String? (readonly)
Returns The content of the message.
800 801 802 |
# File 'lib/discordrb/data/interaction.rb', line 800 def content @content end |
#edited ⇒ true, false (readonly)
815 816 817 |
# File 'lib/discordrb/data/interaction.rb', line 815 def edited @edited end |
#edited_timestamp ⇒ Time? (readonly)
812 813 814 |
# File 'lib/discordrb/data/interaction.rb', line 812 def @edited_timestamp end |
#embeds ⇒ Array<Embed> (readonly)
827 828 829 |
# File 'lib/discordrb/data/interaction.rb', line 827 def @embeds end |
#flags ⇒ Integer (readonly)
833 834 835 |
# File 'lib/discordrb/data/interaction.rb', line 833 def flags @flags end |
#id ⇒ Integer (readonly)
818 819 820 |
# File 'lib/discordrb/data/interaction.rb', line 818 def id @id end |
#interaction ⇒ Interaction (readonly)
Returns The interaction that created this message.
797 798 799 |
# File 'lib/discordrb/data/interaction.rb', line 797 def interaction @interaction end |
#mentions ⇒ Array<User> (readonly)
830 831 832 |
# File 'lib/discordrb/data/interaction.rb', line 830 def mentions @mentions end |
#message_reference ⇒ Hash? (readonly)
839 840 841 |
# File 'lib/discordrb/data/interaction.rb', line 839 def @message_reference end |
#pinned ⇒ true, false (readonly)
Returns Whether this message is pinned in the channel it belongs to.
803 804 805 |
# File 'lib/discordrb/data/interaction.rb', line 803 def pinned @pinned end |
#timestamp ⇒ Time (readonly)
809 810 811 |
# File 'lib/discordrb/data/interaction.rb', line 809 def @timestamp end |
#tts ⇒ true, false (readonly)
806 807 808 |
# File 'lib/discordrb/data/interaction.rb', line 806 def tts @tts end |
Instance Method Details
#channel ⇒ Channel
Returns The channel the interaction originates from.
899 900 901 |
# File 'lib/discordrb/data/interaction.rb', line 899 def channel @bot.channel(@channel_id) end |
#delete ⇒ Object
Delete this message.
911 912 913 |
# File 'lib/discordrb/data/interaction.rb', line 911 def delete @interaction.(@id) end |
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Edit this message's data.
920 921 922 |
# File 'lib/discordrb/data/interaction.rb', line 920 def edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil, &block) @interaction.(@id, content: content, embeds: , allowed_mentions: allowed_mentions, components: components, attachments: , &block) end |
#member ⇒ Member?
Returns This will return nil if the bot does not have access to the server the interaction originated in.
887 888 889 |
# File 'lib/discordrb/data/interaction.rb', line 887 def member server&.member(@user.id) end |
#respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Respond to this message.
906 907 908 |
# File 'lib/discordrb/data/interaction.rb', line 906 def respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil, attachments: nil, &block) @interaction.(content: content, embeds: , allowed_mentions: allowed_mentions, flags: flags, ephemeral: ephemeral, components: components, attachments: , &block) end |
#server ⇒ Server?
Returns This will return nil if the bot does not have access to the server the interaction originated in.
893 894 895 |
# File 'lib/discordrb/data/interaction.rb', line 893 def server @bot.server(@server_id) end |
#to_message ⇒ Discordrb::Message Also known as: message
925 926 927 |
# File 'lib/discordrb/data/interaction.rb', line 925 def Discordrb::Message.new(@data, @bot) end |