mirror of
https://github.com/discordeno/discordeno.git
synced 2026-06-16 19:28:17 +00:00
Oopsie
This commit is contained in:
+10
-6
@@ -2,15 +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 (data.tags ?? {}),
|
||||
integrationID: data.tags?.integration_id,
|
||||
};
|
||||
|
||||
return {
|
||||
...data,
|
||||
...rest,
|
||||
/** The @ mention of the role in a string. */
|
||||
mention: `<@&${data.id}>`,
|
||||
tags: {
|
||||
botID: data.tags?.botID,
|
||||
premiumSubscriber: "premium_subscriber" in (data.tags ?? {}),
|
||||
integrationID: data.tags?.integrationID,
|
||||
},
|
||||
tags: roleTags,
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user