swc/bundler/tests/.cache/deno/020cccee8635a75fe889ea33c2a663e761999e24.ts
강동윤 d60c3242af
fix(swc): Fix bugs (#1739)
swc_bundler:
 - Fix cycle detection for complex circular imports. (denoland/deno#10752)

swc_ecma_transforms_typescript:
 - Allow using large values for an enum variant.
2021-05-25 14:30:17 +09:00

24 lines
942 B
TypeScript

// Loaded from https://deno.land/x/discordeno@11.0.0-rc.2/src/helpers/guilds/get_audit_logs.ts
import { rest } from "../../rest/rest.ts";
import type { AuditLog } from "../../types/audit_log/audit_log.ts";
import type { GetGuildAuditLog } from "../../types/audit_log/get_guild_audit_log.ts";
import { endpoints } from "../../util/constants.ts";
import { requireBotGuildPermissions } from "../../util/permissions.ts";
import { snakelize } from "../../util/utils.ts";
/** Returns the audit logs for the guild. Requires VIEW AUDIT LOGS permission */
export async function getAuditLogs(guildId: bigint, options: Partial<GetGuildAuditLog>) {
await requireBotGuildPermissions(guildId, ["VIEW_AUDIT_LOG"]);
return await rest.runMethod<AuditLog>(
"get",
endpoints.GUILD_AUDIT_LOGS(guildId),
snakelize({
...options,
limit: options.limit && options.limit >= 1 && options.limit <= 100 ? options.limit : 50,
})
);
}