Class: Discorb::Webhook::Message
- Inherits:
-
Message
- Object
- DiscordModel
- Message
- Discorb::Webhook::Message
- Defined in:
- lib/discorb/webhook.rb
Overview
Represents a webhook message.
Defined Under Namespace
Classes: Author
Instance Attribute Summary collapse
-
#channel_id -> Discorb::Snowflake
readonly
The ID of the channel.
-
#guild_id -> Discorb::Snowflake
readonly
The ID of the guild.
Attributes inherited from Message
#activity, #application_id, #attachments, #author, #channel, #components, #content, #created_at, #deleted, #edited?, #embed, #embeds, #guild, #id, #interaction, #jump_url, #mention_everyone, #message_reference, #pinned, #reactions, #stickers, #thread, #tts, #type, #updated_at, #webhook?, #webhook_id
Instance Method Summary collapse
-
#delete! -> Object
Deletes the message.
-
#edit -> Object
Edits the message.
Methods inherited from Message
#add_reaction, #fetch_reacted_users, #flag, #inspect, #pin, #publish, #remove_reaction, #remove_reaction_of, #reply, #start_thread, #to_reference, #unpin
Methods inherited from DiscordModel
Instance Attribute Details
#channel_id -> Discorb::Snowflake (readonly)
Returns The ID of the channel.
300 301 302 |
# File 'lib/discorb/webhook.rb', line 300 def channel_id @channel_id end |
#guild_id -> Discorb::Snowflake (readonly)
Returns The ID of the guild.
302 303 304 |
# File 'lib/discorb/webhook.rb', line 302 def guild_id @guild_id end |
Instance Method Details
#delete! -> Object
This is an asynchronous method, it will return a Async::Task
object. Use Async::Task#wait
to get the result.
This method calls HTTP request.
Deletes the message.
331 332 333 334 335 |
# File 'lib/discorb/webhook.rb', line 331 def delete! Async do @webhook.(self).wait end end |
#edit -> Object
This is an asynchronous method, it will return a Async::Task
object. Use Async::Task#wait
to get the result.
This method calls HTTP request.
The arguments of this method are defaultly set to :unset
. Specify value to set the value, if not don't specify or specify :unset
.
Edits the message.
320 321 322 323 324 |
# File 'lib/discorb/webhook.rb', line 320 def edit(...) Async do @webhook.(self, ...).wait end end |