From ec3a6f21e208eb52f2f97b5a07252878ee3cbd57 Mon Sep 17 00:00:00 2001 From: ayntee Date: Tue, 3 Nov 2020 05:26:43 -0800 Subject: [PATCH] Add Role.tags property --- src/structures/role.ts | 5 +++++ src/types/role.ts | 8 ++++++++ 2 files changed, 13 insertions(+) diff --git a/src/structures/role.ts b/src/structures/role.ts index 8f8f87e3d..9179c06d8 100644 --- a/src/structures/role.ts +++ b/src/structures/role.ts @@ -6,6 +6,11 @@ export async function createRole(data: RoleData) { ...data, /** 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, + }, }; } diff --git a/src/types/role.ts b/src/types/role.ts index 743330a71..78011d198 100644 --- a/src/types/role.ts +++ b/src/types/role.ts @@ -15,4 +15,12 @@ export interface RoleData { managed: boolean; /** whether this role is mentionable */ mentionable: boolean; + /** */ + tags: RoleTags | null; +} + +export interface RoleTags { + botID?: string; + premiumSubscriber?: boolean; + integrationID?: string; }