mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 09:50:07 +00:00
13 lines
519 B
TypeScript
13 lines
519 B
TypeScript
import type { Ban } from "../../types/guilds/ban.ts";
|
|
import type { Bot } from "../../bot.ts";
|
|
|
|
/** 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 async function getBan(bot: Bot, guildId: bigint, memberId: bigint) {
|
|
const result = await bot.rest.runMethod<Ban>(bot.rest, "get", bot.constants.endpoints.GUILD_BAN(guildId, memberId));
|
|
|
|
return {
|
|
reason: result.reason,
|
|
user: bot.transformers.user(bot, result.user),
|
|
};
|
|
}
|