mirror of
https://github.com/discordeno/discordeno.git
synced 2026-09-17 08:47: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>
30 lines
864 B
TypeScript
30 lines
864 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
|
|
/**
|
|
* Deletes a permission override for a user or role in a channel.
|
|
*
|
|
* @param bot - The bot instance to use to make the request.
|
|
* @param channelId - The ID of the channel to delete the permission override of.
|
|
* @param overwriteId - The ID of the permission override to delete.
|
|
*
|
|
* @remarks
|
|
* Requires the `MANAGE_ROLES` permission.
|
|
*
|
|
* Fires a _Channel Update_ gateway event.
|
|
*
|
|
* @see {@link https://discord.com/developers/docs/resources/channel#delete-channel-permission}
|
|
*/
|
|
export async function deleteChannelPermissionOverride(
|
|
bot: Bot,
|
|
channelId: bigint,
|
|
overwriteId: bigint,
|
|
reason?: string,
|
|
): Promise<void> {
|
|
return await bot.rest.runMethod<void>(
|
|
bot.rest,
|
|
"DELETE",
|
|
bot.constants.routes.CHANNEL_OVERWRITE(channelId, overwriteId),
|
|
reason ? { reason } : undefined,
|
|
);
|
|
}
|