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
-
#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) {|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) {|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.
Methods included from Discordrb::IDObject
#==, #creation_time, synthesise
Instance Attribute Details
#attachments ⇒ Attachment (readonly)
622 623 624 |
# File 'lib/discordrb/data/interaction.rb', line 622 def @attachments end |
#author ⇒ User (readonly)
Returns The user of the application.
619 620 621 |
# File 'lib/discordrb/data/interaction.rb', line 619 def @author end |
#channel_id ⇒ Integer (readonly)
634 635 636 |
# File 'lib/discordrb/data/interaction.rb', line 634 def channel_id @channel_id end |
#content ⇒ String? (readonly)
Returns The content of the message.
598 599 600 |
# File 'lib/discordrb/data/interaction.rb', line 598 def content @content end |
#edited ⇒ true, false (readonly)
613 614 615 |
# File 'lib/discordrb/data/interaction.rb', line 613 def edited @edited end |
#edited_timestamp ⇒ Time? (readonly)
610 611 612 |
# File 'lib/discordrb/data/interaction.rb', line 610 def @edited_timestamp end |
#embeds ⇒ Array<Embed> (readonly)
625 626 627 |
# File 'lib/discordrb/data/interaction.rb', line 625 def @embeds end |
#flags ⇒ Integer (readonly)
631 632 633 |
# File 'lib/discordrb/data/interaction.rb', line 631 def flags @flags end |
#id ⇒ Integer (readonly)
616 617 618 |
# File 'lib/discordrb/data/interaction.rb', line 616 def id @id end |
#interaction ⇒ Interaction (readonly)
Returns The interaction that created this message.
595 596 597 |
# File 'lib/discordrb/data/interaction.rb', line 595 def interaction @interaction end |
#mentions ⇒ Array<User> (readonly)
628 629 630 |
# File 'lib/discordrb/data/interaction.rb', line 628 def mentions @mentions end |
#message_reference ⇒ Hash? (readonly)
637 638 639 |
# File 'lib/discordrb/data/interaction.rb', line 637 def @message_reference end |
#pinned ⇒ true, false (readonly)
Returns Whether this message is pinned in the channel it belongs to.
601 602 603 |
# File 'lib/discordrb/data/interaction.rb', line 601 def pinned @pinned end |
#timestamp ⇒ Time (readonly)
607 608 609 |
# File 'lib/discordrb/data/interaction.rb', line 607 def @timestamp end |
#tts ⇒ true, false (readonly)
604 605 606 |
# File 'lib/discordrb/data/interaction.rb', line 604 def tts @tts end |
Instance Method Details
#channel ⇒ Channel
Returns The channel the interaction originates from.
692 693 694 |
# File 'lib/discordrb/data/interaction.rb', line 692 def channel @bot.channel(@channel_id) end |
#delete ⇒ Object
Delete this message.
704 705 706 |
# File 'lib/discordrb/data/interaction.rb', line 704 def delete @interaction.(@id) end |
#edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil) {|builder| ... } ⇒ Object
Edit this message's data.
713 714 715 |
# File 'lib/discordrb/data/interaction.rb', line 713 def edit(content: nil, embeds: nil, allowed_mentions: nil, components: nil, &block) @interaction.(@id, content: content, embeds: , allowed_mentions: allowed_mentions, components: components, &block) end |
#member ⇒ Member?
Returns This will return nil if the bot does not have access to the server the interaction originated in.
680 681 682 |
# File 'lib/discordrb/data/interaction.rb', line 680 def member server&.member(@user.id) end |
#respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil) {|builder| ... } ⇒ Object
Respond to this message.
699 700 701 |
# File 'lib/discordrb/data/interaction.rb', line 699 def respond(content: nil, embeds: nil, allowed_mentions: nil, flags: 0, ephemeral: true, components: nil, &block) @interaction.(content: content, embeds: , allowed_mentions: allowed_mentions, flags: flags, ephemeral: ephemeral, components: components, &block) end |
#server ⇒ Server?
Returns This will return nil if the bot does not have access to the server the interaction originated in.
686 687 688 |
# File 'lib/discordrb/data/interaction.rb', line 686 def server @bot.server(@server_id) end |