async function deleteMessages(
  channelId,
  ids,
  reason,
) {
  await requireBotChannelPermissions(channelId, [
    "MANAGE_MESSAGES",
  ]);
  if (ids.length < 2) {
    throw new Error(Errors.DELETE_MESSAGES_MIN);
  }
  if (ids.length > 100) {
    console.warn(
      `This endpoint only accepts a maximum of 100 messages. Deleting the first 100 message ids provided.`,
    );
  }
  return await rest.runMethod(
    "post",
    endpoints.CHANNEL_BULK_DELETE(channelId),
    {
      messages: ids.splice(0, 100),
      reason,
    },
  );
}
/** Delete messages from the channel. 2-100. Requires the MANAGE_MESSAGES permission */
Delete messages from the channel. 2-100. Requires the MANAGE_MESSAGES permission
Delete messages from the channel . 2 - 100 . Requires the MANAGE_MESSAGES permission
async function deleteMessages(
  channelId,
  ids,
  reason,
) {
  await requireBotChannelPermissions(channelId, [
    "MANAGE_MESSAGES",
  ]);
  if (ids.length < 2) {
    throw new Error(Errors.DELETE_MESSAGES_MIN);
  }
  if (ids.length > 100) {
    console.warn(
      `This endpoint only accepts a maximum of 100 messages. Deleting the first 100 message ids provided.`,
    );
  }
  return await rest.runMethod(
    "post",
    endpoints.CHANNEL_BULK_DELETE(channelId),
    {
      messages: ids.splice(0, 100),
      reason,
    },
  );
}
async function deleteMessages ( channelId , ids , reason , ) { await requireBotChannelPermissions ( channelId , [ "MANAGE_MESSAGES" , ] ) ; if ( ids . length < 2 ) { throw new Error ( Errors . DELETE_MESSAGES_MIN ) ; } if ( ids . length > 100 ) { console . warn ( ` ` , ) ; } return await rest . runMethod ( "post" , endpoints . CHANNEL_BULK_DELETE ( channelId ) , { messages : ids . splice ( 0 , 100 ) , reason , } , ) ; }
Delete messages from the channel.
Delete messages from the channel .