async function deleteMessage(
  channelId,
  messageId,
  reason,
  delayMilliseconds = 0,
) {
  const message = await cacheHandlers.get("messages", messageId);
  if (message && message.authorId !== botId) {
    await requireBotChannelPermissions(message.channelId, [
      "MANAGE_MESSAGES",
    ]);
  }
  if (delayMilliseconds) await delay(delayMilliseconds);
  return await rest.runMethod(
    "delete",
    endpoints.CHANNEL_MESSAGE(channelId, messageId),
    {
      reason,
    },
  );
}
/** Delete a message with the channel id and message id only. */
Delete a message with the channel id and message id only.
Delete a message with the channel id and message id only .
async function deleteMessage(
  channelId,
  messageId,
  reason,
  delayMilliseconds = 0,
) {
  const message = await cacheHandlers.get("messages", messageId);
  if (message && message.authorId !== botId) {
    await requireBotChannelPermissions(message.channelId, [
      "MANAGE_MESSAGES",
    ]);
  }
  if (delayMilliseconds) await delay(delayMilliseconds);
  return await rest.runMethod(
    "delete",
    endpoints.CHANNEL_MESSAGE(channelId, messageId),
    {
      reason,
    },
  );
}
async function deleteMessage ( channelId , messageId , reason , delayMilliseconds = 0 , ) { const message = await cacheHandlers . get ( "messages" , messageId ) ; if ( message && message . authorId !== botId ) { await requireBotChannelPermissions ( message . channelId , [ "MANAGE_MESSAGES" , ] ) ; } if ( delayMilliseconds ) await delay ( delayMilliseconds ) ; return await rest . runMethod ( "delete" , endpoints . CHANNEL_MESSAGE ( channelId , messageId ) , { reason , } , ) ; }
Delete a message with the channel id and message id only.
Delete a message with the channel id and message id only .