Files
discordeno/helpers/roles/addRole.ts
2022-02-11 09:49:53 +00:00

12 lines
345 B
TypeScript

import type { Bot } from "../../bot.ts";
/** Add a role to the member */
export async function addRole(bot: Bot, guildId: bigint, memberId: bigint, roleId: bigint, reason?: string) {
await bot.rest.runMethod<undefined>(
bot.rest,
"put",
bot.constants.endpoints.GUILD_MEMBER_ROLE(guildId, memberId, roleId),
{ reason },
);
}