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)
819 820 821 |
# File 'lib/discordrb/data/interaction.rb', line 819 def @attachments end |
#author ⇒ User (readonly)
Returns The user of the application.
816 817 818 |
# File 'lib/discordrb/data/interaction.rb', line 816 def @author end |
#channel_id ⇒ Integer (readonly)
831 832 833 |
# File 'lib/discordrb/data/interaction.rb', line 831 def channel_id @channel_id end |
#components ⇒ Array<Component> (readonly)
837 838 839 |
# File 'lib/discordrb/data/interaction.rb', line 837 def components @components end |
#content ⇒ String? (readonly)
Returns The content of the message.
795 796 797 |
# File 'lib/discordrb/data/interaction.rb', line 795 def content @content end |
#edited ⇒ true, false (readonly)
810 811 812 |
# File 'lib/discordrb/data/interaction.rb', line 810 def edited @edited end |
#edited_timestamp ⇒ Time? (readonly)
807 808 809 |
# File 'lib/discordrb/data/interaction.rb', line 807 def @edited_timestamp end |
#embeds ⇒ Array<Embed> (readonly)
822 823 824 |
# File 'lib/discordrb/data/interaction.rb', line 822 def @embeds end |
#flags ⇒ Integer (readonly)
828 829 830 |
# File 'lib/discordrb/data/interaction.rb', line 828 def flags @flags end |
#id ⇒ Integer (readonly)
813 814 815 |
# File 'lib/discordrb/data/interaction.rb', line 813 def id @id end |
#interaction ⇒ Interaction (readonly)
Returns The interaction that created this message.
792 793 794 |
# File 'lib/discordrb/data/interaction.rb', line 792 def interaction @interaction end |
#mentions ⇒ Array<User> (readonly)
825 826 827 |
# File 'lib/discordrb/data/interaction.rb', line 825 def mentions @mentions end |
#message_reference ⇒ Hash? (readonly)
834 835 836 |
# File 'lib/discordrb/data/interaction.rb', line 834 def @message_reference end |
#pinned ⇒ true, false (readonly)
Returns Whether this message is pinned in the channel it belongs to.
798 799 800 |
# File 'lib/discordrb/data/interaction.rb', line 798 def pinned @pinned end |
#timestamp ⇒ Time (readonly)
804 805 806 |
# File 'lib/discordrb/data/interaction.rb', line 804 def @timestamp end |
#tts ⇒ true, false (readonly)
801 802 803 |
# File 'lib/discordrb/data/interaction.rb', line 801 def tts @tts end |
Instance Method Details
#channel ⇒ Channel
Returns The channel the interaction originates from.
894 895 896 |
# File 'lib/discordrb/data/interaction.rb', line 894 def channel @bot.channel(@channel_id) end |
#delete ⇒ Object
Delete this message.
906 907 908 |
# File 'lib/discordrb/data/interaction.rb', line 906 def delete @interaction.(@id) end |
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Edit this message's data.
915 916 917 |
# File 'lib/discordrb/data/interaction.rb', line 915 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.
882 883 884 |
# File 'lib/discordrb/data/interaction.rb', line 882 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.
901 902 903 |
# File 'lib/discordrb/data/interaction.rb', line 901 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.
888 889 890 |
# File 'lib/discordrb/data/interaction.rb', line 888 def server @bot.server(@server_id) end |
#to_message ⇒ Discordrb::Message Also known as: message
920 921 922 |
# File 'lib/discordrb/data/interaction.rb', line 920 def Discordrb::Message.new(@data, @bot) end |