mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 03:18:17 +00:00
23 lines
788 B
TypeScript
23 lines
788 B
TypeScript
import type { ModifyGuildMember } from "../../types/guilds/modifyGuildMember.ts";
|
|
import type { GuildMemberWithUser } from "../../types/members/guildMember.ts";
|
|
import type { Bot } from "../../bot.ts";
|
|
|
|
/** Edit the member */
|
|
export async function editMember(bot: Bot, guildId: bigint, memberId: bigint, options: ModifyGuildMember) {
|
|
const result = await bot.rest.runMethod<GuildMemberWithUser>(
|
|
bot.rest,
|
|
"patch",
|
|
bot.constants.endpoints.GUILD_MEMBER(guildId, memberId),
|
|
{
|
|
nick: options.nick,
|
|
roles: options.roles,
|
|
mute: options.mute,
|
|
deaf: options.deaf,
|
|
channel_id: options.channelId,
|
|
communication_disabled_until: options.communicationDisabledUntil,
|
|
},
|
|
);
|
|
|
|
return bot.transformers.member(bot, result, guildId, memberId);
|
|
}
|