types: add role types (#717)

* move perm types

* types: add role types

* types: add roletags types

Co-authored-by: ayntee <ayyantee@gmail.com>
This commit is contained in:
ITOH
2021-03-30 12:10:53 +04:00
committed by GitHub
co-authored by ayntee
parent c2757b2491
commit 79be200943
4 changed files with 39 additions and 0 deletions
+26
View File
@@ -0,0 +1,26 @@
import { SnakeCaseProps } from "../util.ts";
import { RoleTags } from "./role_tags.ts";
export interface Role {
/** Role id */
id: string;
/** Role name */
name: string;
/** Integer representation of hexadecimal color code */
color: number;
/** If this role is showed seperately in the user listing */
hoist: boolean;
/** Position of this role */
position: number;
/** Permission bit set */
permissions: string;
/** Whether this role is managed by an integration */
managed: boolean;
/** Whether this role is mentionable */
mentionable: boolean;
/** The tags this role has */
tags?: RoleTags;
}
/** https://discord.com/developers/docs/topics/permissions#role-object-role-structure */
export type DiscordRole = SnakeCaseProps<Role>;
+13
View File
@@ -0,0 +1,13 @@
import { SnakeCaseProps } from "../util.ts";
export interface RoleTags {
/** The id of the bot this role belongs to */
botId?: string;
/** The id of the integration this role belongs to */
integrationId?: string;
/** Whether this is the guild's premium subscriber role */
premiumSubscriber?: null;
}
/** https://discord.com/developers/docs/topics/permissions#role-object-role-tags-structure */
export type DiscordRoleTags = SnakeCaseProps<RoleTags>;