diff --git a/src/helpers/guilds/get_audit_logs.ts b/src/helpers/guilds/get_audit_logs.ts index 73f9cbfc5..ed8e9ab0d 100644 --- a/src/helpers/guilds/get_audit_logs.ts +++ b/src/helpers/guilds/get_audit_logs.ts @@ -6,7 +6,7 @@ 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) { +export async function getAuditLogs(guildId: bigint, options?: GetGuildAuditLog) { await requireBotGuildPermissions(guildId, ["VIEW_AUDIT_LOG"]); return await rest.runMethod( @@ -14,7 +14,7 @@ export async function getAuditLogs(guildId: bigint, options: Partial= 1 && options.limit <= 100 ? options.limit : 50, + limit: options?.limit && options.limit >= 1 && options.limit <= 100 ? options.limit : 50, }) ); } diff --git a/src/structures/guild.ts b/src/structures/guild.ts index 05e68a8c2..b4ed5cd9a 100644 --- a/src/structures/guild.ts +++ b/src/structures/guild.ts @@ -418,7 +418,7 @@ export interface DiscordenoGuild /** Edit the server. Requires the MANAGE_GUILD permission. */ edit(options: ModifyGuild): ReturnType; /** Returns the audit logs for the guild. Requires VIEW AUDIT LOGS permission */ - auditLogs(options: Partial): ReturnType; + auditLogs(options?: GetGuildAuditLog): ReturnType; /** Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the BAN_MEMBERS permission. */ getBan(memberId: bigint): ReturnType; /** Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission. */