executeWebhook abstract method

  1. @MultiPart.new()
  2. @POST.new('/webhooks/{webhook_id}/{token}')
Future<MessageResponseSchema> executeWebhook({
  1. @Path.new('webhook_id') required SnowflakeType webhookId,
  2. @Path.new('token') required String token,
  3. @Query.new('wait') String? wait,
  4. @Part.new(name: 'content') MessageContentRequest? content,
  5. @Part.new(name: 'embeds') List<RichEmbedRequest>? embeds,
  6. @Part.new(name: 'attachments') List<WebhookAttachmentRequest>? attachments,
  7. @Part.new(name: 'message_reference') MessageReferenceRequest? messageReference,
  8. @Part.new(name: 'allowed_mentions') AllowedMentionsRequest? allowedMentions,
  9. @Part.new(name: 'flags') MessageFlags? flags,
  10. @Part.new(name: 'nonce') MessageNonceRequest? nonce,
  11. @Part.new(name: 'favorite_meme_id') SnowflakeType? favoriteMemeId,
  12. @Part.new(name: 'sticker_ids') List<SnowflakeType>? stickerIds,
  13. @Part.new(name: 'tts') bool? tts,
  14. @Part.new(name: 'username') String? username,
  15. @Part.new(name: 'avatar_url') String? avatarUrl,
})

Execute webhook.

Executes the webhook by sending a message to its configured channel. If the wait query parameter is true, returns the created message object; otherwise returns a 204 status with no content.

webhookId - The ID of the webhook.

token - The token.

content - Name not received - field will be skipped. Name not received - field will be skipped.

embeds - Array of embed objects to include in the message. Name not received - field will be skipped.

attachments - Array of attachment objects. Name not received - field will be skipped.

messageReference - Name not received - field will be skipped. Name not received - field will be skipped.

allowedMentions - Name not received - field will be skipped. Name not received - field will be skipped.

flags - Name not received - field will be skipped.

nonce - Name not received - field will be skipped.

favoriteMemeId - Name not received - field will be skipped. Name not received - field will be skipped.

stickerIds - Name not received - field will be skipped. Name not received - field will be skipped.

tts - Whether this is a text-to-speech message. Name not received - field will be skipped.

username - Name not received - field will be skipped. Name not received - field will be skipped.

avatarUrl - Name not received - field will be skipped. Name not received - field will be skipped.

Implementation

@MultiPart()
@POST('/webhooks/{webhook_id}/{token}')
Future<MessageResponseSchema> executeWebhook({
  @Path('webhook_id') required SnowflakeType webhookId,
  @Path('token') required String token,
  @Query('wait') String? wait,
  @Part(name: 'content') MessageContentRequest? content,
  @Part(name: 'embeds') List<RichEmbedRequest>? embeds,
  @Part(name: 'attachments') List<WebhookAttachmentRequest>? attachments,
  @Part(name: 'message_reference') MessageReferenceRequest? messageReference,
  @Part(name: 'allowed_mentions') AllowedMentionsRequest? allowedMentions,
  @Part(name: 'flags') MessageFlags? flags,
  @Part(name: 'nonce') MessageNonceRequest? nonce,
  @Part(name: 'favorite_meme_id') SnowflakeType? favoriteMemeId,
  @Part(name: 'sticker_ids') List<SnowflakeType>? stickerIds,
  @Part(name: 'tts') bool? tts,
  @Part(name: 'username') String? username,
  @Part(name: 'avatar_url') String? avatarUrl,
});