@@ -2572,12 +2572,48 @@ impl Http {
25722572 wait : bool ,
25732573 files : Vec < CreateAttachment > ,
25742574 map : & impl serde:: Serialize ,
2575+ ) -> Result < Option < Message > > {
2576+ self . execute_webhook_ ( webhook_id, thread_id, token, wait, files, map, false ) . await
2577+ }
2578+
2579+ /// Same as [`Self::execute_webhook`] but allows sending non interactive components on non
2580+ /// app-owned webhooks.
2581+ ///
2582+ /// Refer to the [Discord docs] for more information on how this works.
2583+ ///
2584+ /// [Discord docs]: https://discord.com/developers/docs/resources/webhook#execute-webhook-query-string-params
2585+ pub async fn execute_webhook_with_components (
2586+ & self ,
2587+ webhook_id : WebhookId ,
2588+ thread_id : Option < ChannelId > ,
2589+ token : & str ,
2590+ wait : bool ,
2591+ files : Vec < CreateAttachment > ,
2592+ map : & impl serde:: Serialize ,
2593+ ) -> Result < Option < Message > > {
2594+ self . execute_webhook_ ( webhook_id, thread_id, token, wait, files, map, true ) . await
2595+ }
2596+
2597+ #[ allow( clippy:: too_many_arguments) ]
2598+ async fn execute_webhook_ (
2599+ & self ,
2600+ webhook_id : WebhookId ,
2601+ thread_id : Option < ChannelId > ,
2602+ token : & str ,
2603+ wait : bool ,
2604+ files : Vec < CreateAttachment > ,
2605+ map : & impl serde:: Serialize ,
2606+ with_components : bool ,
25752607 ) -> Result < Option < Message > > {
25762608 let mut params = vec ! [ ( "wait" , wait. to_string( ) ) ] ;
25772609 if let Some ( thread_id) = thread_id {
25782610 params. push ( ( "thread_id" , thread_id. to_string ( ) ) ) ;
25792611 }
25802612
2613+ if with_components {
2614+ params. push ( ( "with_components" , with_components. to_string ( ) ) ) ;
2615+ }
2616+
25812617 let mut request = Request {
25822618 body : None ,
25832619 multipart : None ,
0 commit comments