mirror of
https://github.com/discordeno/discordeno.git
synced 2026-05-30 23:40:07 +00:00
20 lines
471 B
TypeScript
20 lines
471 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
|
|
/** Delete a message with the channel id and message id only. */
|
|
export async function deleteMessage(
|
|
bot: Bot,
|
|
channelId: bigint,
|
|
messageId: bigint,
|
|
reason?: string,
|
|
delayMilliseconds = 0,
|
|
) {
|
|
if (delayMilliseconds) await bot.utils.delay(delayMilliseconds);
|
|
|
|
await bot.rest.runMethod<undefined>(
|
|
bot.rest,
|
|
"delete",
|
|
bot.constants.endpoints.CHANNEL_MESSAGE(channelId, messageId),
|
|
{ reason },
|
|
);
|
|
}
|