fix(bot): remove webhook after use

This commit is contained in:
xHyroM 2023-04-09 15:44:24 +02:00
parent 54c28c6bf4
commit df7f84d1aa
No known key found for this signature in database
GPG key ID: BE0423F386C436AA

View file

@ -158,6 +158,16 @@ export default async function (ctx: Context, data: Data) {
await ctx.editReply({ await ctx.editReply({
content: `Error: ${json.message} (${json.code})`, content: `Error: ${json.message} (${json.code})`,
}); });
} else {
await fetch(
`${RouteBases.api}${Routes.webhook(
data.webhook.id,
data.webhook.token,
)}`,
{
method: "DELETE",
},
);
} }
} }
} }