mirror of
https://github.com/swc-project/swc.git
synced 2024-12-21 12:41:54 +03:00
d60c3242af
swc_bundler: - Fix cycle detection for complex circular imports. (denoland/deno#10752) swc_ecma_transforms_typescript: - Allow using large values for an enum variant.
24 lines
942 B
TypeScript
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,
|
|
})
|
|
);
|
|
}
|