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";
|
import { RoleData } from "../types/role.ts";
|
||||||
|
|
||||||
export async function createRole(data: RoleData) {
|
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 {
|
return {
|
||||||
...data,
|
...rest,
|
||||||
/** The @ mention of the role in a string. */
|
/** The @ mention of the role in a string. */
|
||||||
mention: `<@&${data.id}>`,
|
mention: `<@&${data.id}>`,
|
||||||
tags: {
|
tags: roleTags,
|
||||||
botID: data.tags?.botID,
|
|
||||||
premiumSubscriber: "premium_subscriber" in (data.tags ?? {}),
|
|
||||||
integrationID: data.tags?.integrationID,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+3
-3
@@ -20,7 +20,7 @@ export interface RoleData {
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface RoleTags {
|
export interface RoleTags {
|
||||||
botID?: string;
|
bot_id?: string;
|
||||||
premiumSubscriber?: boolean;
|
premium_subscriber?: boolean;
|
||||||
integrationID?: string;
|
integration_id?: string;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user