Skip to content

Commit 7de00aa

Browse files
committed
chore: upgrade stoat-api
1 parent a672fea commit 7de00aa

3 files changed

Lines changed: 13 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@vladfrangu/async_event_emitter": "^2.4.6",
3232
"json-with-bigint": "^3.4.4",
3333
"solid-js": "^1.9.6",
34-
"stoat-api": "0.12.0",
34+
"stoat-api": "0.13.5",
3535
"ulid": "^3.0.2"
3636
},
3737
"devDependencies": {

src/classes/ServerMember.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,10 @@ export class ServerMember {
111111
* Ordered list of roles for this member, from lowest to highest priority.
112112
*/
113113
get orderedRoles(): (Partial<
114-
Omit<Role, "permissions"> & { permissions: { a: bigint; d: bigint } }
114+
Omit<Role, "permissions" | "icon"> & {
115+
permissions: { a: bigint; d: bigint };
116+
icon?: File;
117+
}
115118
> & { id: string })[] {
116119
const server = this.server!;
117120
return (
@@ -128,7 +131,10 @@ export class ServerMember {
128131
* Member's currently hoisted role.
129132
*/
130133
get hoistedRole(): Partial<
131-
Omit<Role, "permissions"> & { permissions: { a: bigint; d: bigint } }
134+
Omit<Role, "permissions" | "icon"> & {
135+
permissions: { a: bigint; d: bigint };
136+
icon?: File;
137+
}
132138
> | null {
133139
const roles = this.orderedRoles.filter((x) => x.hoist);
134140
if (roles.length > 0) {

src/classes/ServerRole.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import type { Role as APIRole } from "stoat-api";
22

33
import type { Client } from "../Client.js";
44

5+
import { File } from "./File.js";
6+
57
/**
68
* Server Role
79
*/
@@ -11,6 +13,7 @@ export class ServerRole {
1113

1214
readonly id: string;
1315
readonly name: string;
16+
readonly icon?: File;
1417
readonly permissions: {
1518
a: bigint;
1619
d: bigint;
@@ -32,6 +35,7 @@ export class ServerRole {
3235

3336
this.id = id;
3437
this.name = data.name;
38+
this.icon = data.icon ? new File(client, data.icon) : undefined;
3539
this.permissions = {
3640
a: BigInt(data.permissions.a),
3741
d: BigInt(data.permissions.d),

0 commit comments

Comments
 (0)