mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-03 01:10:07 +00:00
getBan single ban fetch function
This commit is contained in:
2
egg.yml
2
egg.yml
@@ -2,7 +2,7 @@ name: Discordeno
|
||||
description: >-
|
||||
Discord Deno TypeScript API library wrapper(Officially vetted library by
|
||||
Discord Team) https://discordeno.netlify.app
|
||||
version: 8.5.0
|
||||
version: 8.7.0
|
||||
stable: true
|
||||
files:
|
||||
- ./src/**/*
|
||||
|
||||
@@ -509,6 +509,19 @@ export async function getBans(guildID: string) {
|
||||
);
|
||||
}
|
||||
|
||||
/** Returns a ban object for the given user or a 404 not found if the ban cannot be found. Requires the BAN_MEMBERS permission. */
|
||||
export function getBan(guildID: string, memberID: string) {
|
||||
if (
|
||||
!botHasPermission(guildID, [Permissions.BAN_MEMBERS])
|
||||
) {
|
||||
throw new Error(Errors.MISSING_BAN_MEMBERS);
|
||||
}
|
||||
|
||||
return RequestManager.get(
|
||||
endpoints.GUILD_BAN(guildID, memberID),
|
||||
) as Promise<BannedUser>;
|
||||
}
|
||||
|
||||
/** Ban a user from the guild and optionally delete previous messages sent by the user. Requires teh BAN_MEMBERS permission. */
|
||||
export function ban(guildID: string, id: string, options: BanOptions) {
|
||||
if (
|
||||
|
||||
Reference in New Issue
Block a user