these are optional too

This commit is contained in:
ITOH
2021-05-26 20:49:28 +02:00
parent f13145822a
commit 17f16ee91f
2 changed files with 3 additions and 3 deletions

View File

@@ -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<GetGuildAuditLog>) {
export async function getAuditLogs(guildId: bigint, options?: GetGuildAuditLog) {
await requireBotGuildPermissions(guildId, ["VIEW_AUDIT_LOG"]);
return await rest.runMethod<AuditLog>(
@@ -14,7 +14,7 @@ export async function getAuditLogs(guildId: bigint, options: Partial<GetGuildAud
endpoints.GUILD_AUDIT_LOGS(guildId),
snakelize({
...options,
limit: options.limit && options.limit >= 1 && options.limit <= 100 ? options.limit : 50,
limit: options?.limit && options.limit >= 1 && options.limit <= 100 ? options.limit : 50,
})
);
}

View File

@@ -418,7 +418,7 @@ export interface DiscordenoGuild
/** Edit the server. Requires the MANAGE_GUILD permission. */
edit(options: ModifyGuild): ReturnType<typeof editGuild>;
/** Returns the audit logs for the guild. Requires VIEW AUDIT LOGS permission */
auditLogs(options: Partial<GetGuildAuditLog>): ReturnType<typeof getAuditLogs>;
auditLogs(options?: GetGuildAuditLog): ReturnType<typeof getAuditLogs>;
/** 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<typeof getBan>;
/** Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission. */