From df7f84d1aafbbf95faf6a80e9339ce30d0256297 Mon Sep 17 00:00:00 2001 From: xHyroM Date: Sun, 9 Apr 2023 15:44:24 +0200 Subject: [PATCH] fix(bot): remove webhook after use --- packages/bot/src/utils/sendFinal.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/packages/bot/src/utils/sendFinal.ts b/packages/bot/src/utils/sendFinal.ts index 3d23586..3a14fe2 100644 --- a/packages/bot/src/utils/sendFinal.ts +++ b/packages/bot/src/utils/sendFinal.ts @@ -158,6 +158,16 @@ export default async function (ctx: Context, data: Data) { await ctx.editReply({ content: `Error: ${json.message} (${json.code})`, }); + } else { + await fetch( + `${RouteBases.api}${Routes.webhook( + data.webhook.id, + data.webhook.token, + )}`, + { + method: "DELETE", + }, + ); } } }