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)
703 704 705 |
# File 'lib/discordrb/data/interaction.rb', line 703 def @attachments end |
#author ⇒ User (readonly)
Returns The user of the application.
700 701 702 |
# File 'lib/discordrb/data/interaction.rb', line 700 def @author end |
#channel_id ⇒ Integer (readonly)
715 716 717 |
# File 'lib/discordrb/data/interaction.rb', line 715 def channel_id @channel_id end |
#components ⇒ Array<Component> (readonly)
721 722 723 |
# File 'lib/discordrb/data/interaction.rb', line 721 def components @components end |
#content ⇒ String? (readonly)
Returns The content of the message.
679 680 681 |
# File 'lib/discordrb/data/interaction.rb', line 679 def content @content end |
#edited ⇒ true, false (readonly)
694 695 696 |
# File 'lib/discordrb/data/interaction.rb', line 694 def edited @edited end |
#edited_timestamp ⇒ Time? (readonly)
691 692 693 |
# File 'lib/discordrb/data/interaction.rb', line 691 def @edited_timestamp end |
#embeds ⇒ Array<Embed> (readonly)
706 707 708 |
# File 'lib/discordrb/data/interaction.rb', line 706 def @embeds end |
#flags ⇒ Integer (readonly)
712 713 714 |
# File 'lib/discordrb/data/interaction.rb', line 712 def flags @flags end |
#id ⇒ Integer (readonly)
697 698 699 |
# File 'lib/discordrb/data/interaction.rb', line 697 def id @id end |
#interaction ⇒ Interaction (readonly)
Returns The interaction that created this message.
676 677 678 |
# File 'lib/discordrb/data/interaction.rb', line 676 def interaction @interaction end |
#mentions ⇒ Array<User> (readonly)
709 710 711 |
# File 'lib/discordrb/data/interaction.rb', line 709 def mentions @mentions end |
#message_reference ⇒ Hash? (readonly)
718 719 720 |
# File 'lib/discordrb/data/interaction.rb', line 718 def @message_reference end |
#pinned ⇒ true, false (readonly)
Returns Whether this message is pinned in the channel it belongs to.
682 683 684 |
# File 'lib/discordrb/data/interaction.rb', line 682 def pinned @pinned end |
#timestamp ⇒ Time (readonly)
688 689 690 |
# File 'lib/discordrb/data/interaction.rb', line 688 def @timestamp end |
#tts ⇒ true, false (readonly)
685 686 687 |
# File 'lib/discordrb/data/interaction.rb', line 685 def tts @tts end |
Instance Method Details
#channel ⇒ Channel
Returns The channel the interaction originates from.
778 779 780 |
# File 'lib/discordrb/data/interaction.rb', line 778 def channel @bot.channel(@channel_id) end |
#delete ⇒ Object
Delete this message.
790 791 792 |
# File 'lib/discordrb/data/interaction.rb', line 790 def delete @interaction.(@id) end |
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, attachments: nil) {|builder| ... } ⇒ Object
Edit this message's data.
799 800 801 |
# File 'lib/discordrb/data/interaction.rb', line 799 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.
766 767 768 |
# File 'lib/discordrb/data/interaction.rb', line 766 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.
785 786 787 |
# File 'lib/discordrb/data/interaction.rb', line 785 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.
772 773 774 |
# File 'lib/discordrb/data/interaction.rb', line 772 def server @bot.server(@server_id) end |
#to_message ⇒ Discordrb::Message Also known as: message
804 805 806 |
# File 'lib/discordrb/data/interaction.rb', line 804 def Discordrb::Message.new(@data, @bot) end |