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)
918 919 920 |
# File 'lib/discordrb/data/interaction.rb', line 918 def @attachments end |
#author ⇒ User (readonly)
Returns The user of the application.
915 916 917 |
# File 'lib/discordrb/data/interaction.rb', line 915 def @author end |
#channel_id ⇒ Integer (readonly)
930 931 932 |
# File 'lib/discordrb/data/interaction.rb', line 930 def channel_id @channel_id end |
#components ⇒ Array<Component> (readonly)
936 937 938 |
# File 'lib/discordrb/data/interaction.rb', line 936 def components @components end |
#content ⇒ String? (readonly)
Returns The content of the message.
894 895 896 |
# File 'lib/discordrb/data/interaction.rb', line 894 def content @content end |
#edited ⇒ true, false (readonly)
909 910 911 |
# File 'lib/discordrb/data/interaction.rb', line 909 def edited @edited end |
#edited_timestamp ⇒ Time? (readonly)
906 907 908 |
# File 'lib/discordrb/data/interaction.rb', line 906 def @edited_timestamp end |
#embeds ⇒ Array<Embed> (readonly)
921 922 923 |
# File 'lib/discordrb/data/interaction.rb', line 921 def @embeds end |
#flags ⇒ Integer (readonly)
927 928 929 |
# File 'lib/discordrb/data/interaction.rb', line 927 def flags @flags end |
#id ⇒ Integer (readonly)
912 913 914 |
# File 'lib/discordrb/data/interaction.rb', line 912 def id @id end |
#interaction ⇒ Interaction (readonly)
Returns The interaction that created this message.
891 892 893 |
# File 'lib/discordrb/data/interaction.rb', line 891 def interaction @interaction end |
#mentions ⇒ Array<User> (readonly)
924 925 926 |
# File 'lib/discordrb/data/interaction.rb', line 924 def mentions @mentions end |
#message_reference ⇒ Hash? (readonly)
933 934 935 |
# File 'lib/discordrb/data/interaction.rb', line 933 def @message_reference end |
#pinned ⇒ true, false (readonly)
Returns Whether this message is pinned in the channel it belongs to.
897 898 899 |
# File 'lib/discordrb/data/interaction.rb', line 897 def pinned @pinned end |
#timestamp ⇒ Time (readonly)
903 904 905 |
# File 'lib/discordrb/data/interaction.rb', line 903 def @timestamp end |
#tts ⇒ true, false (readonly)
900 901 902 |
# File 'lib/discordrb/data/interaction.rb', line 900 def tts @tts end |
Instance Method Details
#channel ⇒ Channel
Returns The channel the interaction originates from.
993 994 995 |
# File 'lib/discordrb/data/interaction.rb', line 993 def channel @bot.channel(@channel_id) end |
#delete ⇒ Object
Delete this message.
1005 1006 1007 |
# File 'lib/discordrb/data/interaction.rb', line 1005 def delete @interaction.(@id) end |
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Edit this message's data.
1014 1015 1016 |
# File 'lib/discordrb/data/interaction.rb', line 1014 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.
981 982 983 |
# File 'lib/discordrb/data/interaction.rb', line 981 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.
1000 1001 1002 |
# File 'lib/discordrb/data/interaction.rb', line 1000 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.
987 988 989 |
# File 'lib/discordrb/data/interaction.rb', line 987 def server @bot.server(@server_id) end |
#to_message ⇒ Discordrb::Message Also known as: message
1019 1020 1021 |
# File 'lib/discordrb/data/interaction.rb', line 1019 def Discordrb::Message.new(@data, @bot) end |