mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-01 16:30:08 +00:00
16 lines
422 B
TypeScript
16 lines
422 B
TypeScript
import type { Bot } from "../../bot.ts";
|
|
|
|
/** Edit the nickname of the bot in this guild */
|
|
export async function editBotNickname(bot: Bot, guildId: bigint, options: { nick: string | null; reason?: string }) {
|
|
const response = await bot.rest.runMethod<{ nick: string }>(
|
|
bot.rest,
|
|
"PATCH",
|
|
bot.constants.routes.USER_NICK(guildId),
|
|
options,
|
|
);
|
|
|
|
if (!response?.nick) return;
|
|
|
|
return response.nick;
|
|
}
|