mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-04 01:40:08 +00:00
Merge branch 'master' of https://github.com/Skillz4Killz/Discordeno into next
This commit is contained in:
@@ -2,10 +2,19 @@ import { Unpromise } from "../types/misc.ts";
|
||||
import { RoleData } from "../types/role.ts";
|
||||
|
||||
export async function createRole(data: RoleData) {
|
||||
const { tags, ...rest } = data;
|
||||
|
||||
const roleTags = {
|
||||
botID: tags?.bot_id,
|
||||
premiumSubscriber: "premium_subscriber" in (tags ?? {}),
|
||||
integrationID: tags?.integration_id,
|
||||
};
|
||||
|
||||
return {
|
||||
...data,
|
||||
...rest,
|
||||
/** The @ mention of the role in a string. */
|
||||
mention: `<@&${data.id}>`,
|
||||
tags: roleTags,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user