mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
change(banMember): make options optional
This commit is contained in:
@@ -5,10 +5,10 @@ import { requireBotGuildPermissions } from "../../util/permissions.ts";
|
|||||||
import { snakelize } from "../../util/utils.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. */
|
/** 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"]);
|
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
|
// aliases
|
||||||
|
|||||||
@@ -441,7 +441,7 @@ export interface DiscordenoGuild
|
|||||||
/** Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission. */
|
/** Returns a list of ban objects for the users banned from this guild. Requires the BAN_MEMBERS permission. */
|
||||||
bans(): ReturnType<typeof getBans>;
|
bans(): ReturnType<typeof getBans>;
|
||||||
/** Ban a user from the guild and optionally delete previous messages sent by the user. Requires the BAN_MEMBERS permission. */
|
/** Ban a user from the guild and optionally delete previous messages sent by the user. Requires the BAN_MEMBERS permission. */
|
||||||
ban(memberId: bigint, options: CreateGuildBan): ReturnType<typeof banMember>;
|
ban(memberId: bigint, options?: CreateGuildBan): ReturnType<typeof banMember>;
|
||||||
/** Remove the ban for a user. Requires BAN_MEMBERS permission */
|
/** Remove the ban for a user. Requires BAN_MEMBERS permission */
|
||||||
unban(memberId: bigint): ReturnType<typeof unbanMember>;
|
unban(memberId: bigint): ReturnType<typeof unbanMember>;
|
||||||
/** Get all the invites for this guild. Requires MANAGE_GUILD permission */
|
/** Get all the invites for this guild. Requires MANAGE_GUILD permission */
|
||||||
|
|||||||
@@ -232,7 +232,9 @@ export interface DiscordenoMember extends Omit<User, "discriminator" | "id" | "a
|
|||||||
/** Get the nickname or the username if no nickname */
|
/** Get the nickname or the username if no nickname */
|
||||||
name(guildId: bigint): string;
|
name(guildId: bigint): string;
|
||||||
/** Get the guild member object for the specified guild */
|
/** Get the guild member object for the specified guild */
|
||||||
guildMember(guildId: bigint):
|
guildMember(
|
||||||
|
guildId: bigint
|
||||||
|
):
|
||||||
| (Omit<GuildMember, "joinedAt" | "premiumSince" | "roles"> & {
|
| (Omit<GuildMember, "joinedAt" | "premiumSince" | "roles"> & {
|
||||||
joinedAt?: number;
|
joinedAt?: number;
|
||||||
premiumSince?: number;
|
premiumSince?: number;
|
||||||
@@ -251,7 +253,7 @@ export interface DiscordenoMember extends Omit<User, "discriminator" | "id" | "a
|
|||||||
}
|
}
|
||||||
): ReturnType<typeof editMember>;
|
): ReturnType<typeof editMember>;
|
||||||
/** Ban a member in a guild */
|
/** Ban a member in a guild */
|
||||||
ban(guildId: bigint, options: CreateGuildBan): ReturnType<typeof banMember>;
|
ban(guildId: bigint, options?: CreateGuildBan): ReturnType<typeof banMember>;
|
||||||
/** Add a role to the member */
|
/** Add a role to the member */
|
||||||
addRole(guildId: bigint, roleId: bigint, reason?: string): ReturnType<typeof addRole>;
|
addRole(guildId: bigint, roleId: bigint, reason?: string): ReturnType<typeof addRole>;
|
||||||
/** Remove a role from the member */
|
/** Remove a role from the member */
|
||||||
|
|||||||
Reference in New Issue
Block a user