mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
these are optional too
This commit is contained in:
@@ -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,
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@@ -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. */
|
||||
|
||||
Reference in New Issue
Block a user