feat: add support for role icons (#6633)

This commit is contained in:
Shubham Parihar
2021-10-03 22:25:29 +05:30
committed by GitHub
parent a8c21cd754
commit 7129965423
5 changed files with 91 additions and 3 deletions

11
typings/index.d.ts vendored
View File

@@ -1647,16 +1647,21 @@ export class Role extends Base {
public rawPosition: number;
public tags: RoleTagData | null;
public comparePositionTo(role: RoleResolvable): number;
public icon: string | null;
public unicodeEmoji: string | null;
public delete(reason?: string): Promise<Role>;
public edit(data: RoleData, reason?: string): Promise<Role>;
public equals(role: Role): boolean;
public iconURL(options?: StaticImageURLOptions): string | null;
public permissionsIn(channel: GuildChannel | Snowflake): Readonly<Permissions>;
public setColor(color: ColorResolvable, reason?: string): Promise<Role>;
public setHoist(hoist?: boolean, reason?: string): Promise<Role>;
public setMentionable(mentionable?: boolean, reason?: string): Promise<Role>;
public setName(name: string, reason?: string): Promise<Role>;
public setPermissions(permissions: PermissionResolvable, reason?: string): Promise<Role>;
public setIcon(icon: BufferResolvable | Base64Resolvable | EmojiResolvable | null, reason?: string): Promise<Role>;
public setPosition(position: number, options?: SetRolePositionOptions): Promise<Role>;
public setUnicodeEmoji(unicodeEmoji: string | null, reason?: string): Promise<Role>;
public toJSON(): unknown;
public toString(): RoleMention;
@@ -2362,6 +2367,7 @@ export const Constants: {
{ format, size }: { format: AllowedImageFormat; size: AllowedImageSize },
) => string;
Sticker: (stickerId: Snowflake, stickerFormat: StickerFormatType) => string;
RoleIcon: (roleId: Snowflake, hash: string, format: AllowedImageFormat, size: AllowedImageSize) => string;
};
};
WSCodes: {
@@ -4069,7 +4075,8 @@ export type GuildFeatures =
| 'MORE_STICKERS'
| 'THREE_DAY_THREAD_ARCHIVE'
| 'SEVEN_DAY_THREAD_ARCHIVE'
| 'PRIVATE_THREADS';
| 'PRIVATE_THREADS'
| 'ROLE_ICONS';
export interface GuildMemberEditData {
nick?: string | null;
@@ -4740,6 +4747,8 @@ export interface RoleData {
position?: number;
permissions?: PermissionResolvable;
mentionable?: boolean;
icon?: BufferResolvable | Base64Resolvable | EmojiResolvable | null;
unicodeEmoji?: string | null;
}
export type RoleMention = '@everyone' | `<@&${Snowflake}>`;