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)
856 857 858 |
# File 'lib/discordrb/data/interaction.rb', line 856 def @attachments end |
#author ⇒ User (readonly)
Returns The user of the application.
853 854 855 |
# File 'lib/discordrb/data/interaction.rb', line 853 def @author end |
#channel_id ⇒ Integer (readonly)
868 869 870 |
# File 'lib/discordrb/data/interaction.rb', line 868 def channel_id @channel_id end |
#components ⇒ Array<Component> (readonly)
874 875 876 |
# File 'lib/discordrb/data/interaction.rb', line 874 def components @components end |
#content ⇒ String? (readonly)
Returns The content of the message.
832 833 834 |
# File 'lib/discordrb/data/interaction.rb', line 832 def content @content end |
#edited ⇒ true, false (readonly)
847 848 849 |
# File 'lib/discordrb/data/interaction.rb', line 847 def edited @edited end |
#edited_timestamp ⇒ Time? (readonly)
844 845 846 |
# File 'lib/discordrb/data/interaction.rb', line 844 def @edited_timestamp end |
#embeds ⇒ Array<Embed> (readonly)
859 860 861 |
# File 'lib/discordrb/data/interaction.rb', line 859 def @embeds end |
#flags ⇒ Integer (readonly)
865 866 867 |
# File 'lib/discordrb/data/interaction.rb', line 865 def flags @flags end |
#id ⇒ Integer (readonly)
850 851 852 |
# File 'lib/discordrb/data/interaction.rb', line 850 def id @id end |
#interaction ⇒ Interaction (readonly)
Returns The interaction that created this message.
829 830 831 |
# File 'lib/discordrb/data/interaction.rb', line 829 def interaction @interaction end |
#mentions ⇒ Array<User> (readonly)
862 863 864 |
# File 'lib/discordrb/data/interaction.rb', line 862 def mentions @mentions end |
#message_reference ⇒ Hash? (readonly)
871 872 873 |
# File 'lib/discordrb/data/interaction.rb', line 871 def @message_reference end |
#pinned ⇒ true, false (readonly)
Returns Whether this message is pinned in the channel it belongs to.
835 836 837 |
# File 'lib/discordrb/data/interaction.rb', line 835 def pinned @pinned end |
#timestamp ⇒ Time (readonly)
841 842 843 |
# File 'lib/discordrb/data/interaction.rb', line 841 def @timestamp end |
#tts ⇒ true, false (readonly)
838 839 840 |
# File 'lib/discordrb/data/interaction.rb', line 838 def tts @tts end |
Instance Method Details
#channel ⇒ Channel
Returns The channel the interaction originates from.
931 932 933 |
# File 'lib/discordrb/data/interaction.rb', line 931 def channel @bot.channel(@channel_id) end |
#delete ⇒ Object
Delete this message.
943 944 945 |
# File 'lib/discordrb/data/interaction.rb', line 943 def delete @interaction.(@id) end |
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Edit this message's data.
952 953 954 |
# File 'lib/discordrb/data/interaction.rb', line 952 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.
919 920 921 |
# File 'lib/discordrb/data/interaction.rb', line 919 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.
938 939 940 |
# File 'lib/discordrb/data/interaction.rb', line 938 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.
925 926 927 |
# File 'lib/discordrb/data/interaction.rb', line 925 def server @bot.server(@server_id) end |
#to_message ⇒ Discordrb::Message Also known as: message
957 958 959 |
# File 'lib/discordrb/data/interaction.rb', line 957 def Discordrb::Message.new(@data, @bot) end |