Add Role.tags property

This commit is contained in:
ayntee
2020-11-03 05:26:43 -08:00
parent e0e5b53e73
commit ec3a6f21e2
2 changed files with 13 additions and 0 deletions

View File

@@ -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,
},
};
}

View File

@@ -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;
}