mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 16:57:22 +00:00
* type WithReason<T> = T & { reason?: string }
* deno fmt (1.25.2)
* WithReason: jsdoc comments for reason
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
* deno fmt
* types: WithReason type -> WithReason interface
* Fix: Some helpers missing support for reason
Co-authored-by: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com>
24 lines
675 B
TypeScript
24 lines
675 B
TypeScript
import type { Bot } from "../../../bot.ts";
|
|
|
|
/**
|
|
* Deletes an invite to a channel.
|
|
*
|
|
* @param bot - The bot instance to use to make the request.
|
|
* @param inviteCode - The invite code of the invite to delete.
|
|
*
|
|
* @remarks
|
|
* Requires the `MANAGE_CHANNELS` permission.
|
|
*
|
|
* Fires an _Invite Delete_ gateway event.
|
|
*
|
|
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-invite}
|
|
*/
|
|
export async function deleteInvite(bot: Bot, inviteCode: string, reason?: string): Promise<void> {
|
|
return await bot.rest.runMethod<void>(
|
|
bot.rest,
|
|
"DELETE",
|
|
bot.constants.routes.INVITE(inviteCode),
|
|
reason ? { reason } : undefined,
|
|
);
|
|
}
|