change(banMember): make options optional

This commit is contained in:
ITOH
2021-06-20 13:54:55 +02:00
parent d75e0549d7
commit 22a08d6f99
3 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -5,10 +5,10 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
import { snakelize } from "../../util/utils.ts";
/** Ban a user from the guild and optionally delete previous messages sent by the user. Requires the BAN_MEMBERS permission. */
export async function ban(guildId: bigint, id: bigint, options: CreateGuildBan) {
export async function ban(guildId: bigint, id: bigint, options?: CreateGuildBan) {
await requireBotGuildPermissions(guildId, ["BAN_MEMBERS"]);
return await rest.runMethod<undefined>("put", endpoints.GUILD_BAN(guildId, id), snakelize(options));
return await rest.runMethod<undefined>("put", endpoints.GUILD_BAN(guildId, id), snakelize(options ?? {}));
}
// aliases