executeWebhook abstract method
- @MultiPart.new()
- @POST.new('/webhooks/{webhook_id}/{token}')
- @Path.new('webhook_id') required SnowflakeType webhookId,
- @Path.new('token') required String token,
- @Query.new('wait') String? wait,
- @Part.new(name: 'content') MessageContentRequest? content,
- @Part.new(name: 'embeds') List<
RichEmbedRequest> ? embeds, - @Part.new(name: 'attachments') List<
WebhookAttachmentRequest> ? attachments, - @Part.new(name: 'message_reference') MessageReferenceRequest? messageReference,
- @Part.new(name: 'allowed_mentions') AllowedMentionsRequest? allowedMentions,
- @Part.new(name: 'flags') MessageFlags? flags,
- @Part.new(name: 'nonce') MessageNonceRequest? nonce,
- @Part.new(name: 'favorite_meme_id') SnowflakeType? favoriteMemeId,
- @Part.new(name: 'sticker_ids') List<
SnowflakeType> ? stickerIds, - @Part.new(name: 'tts') bool? tts,
- @Part.new(name: 'username') String? username,
- @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,
});