diff --git a/src/Client.ts b/src/Client.ts index 1acdb6f2..ff9c035f 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -4,14 +4,14 @@ import { batch, createSignal } from "solid-js"; import { ReactiveMap } from "@solid-primitives/map"; import { AsyncEventEmitter } from "@vladfrangu/async_event_emitter"; import { API } from "stoat-api"; -import type { DataLogin, RevoltConfig, Role, UserLimits } from "stoat-api"; +import type { DataLogin, RevoltConfig, Role } from "stoat-api"; import type { Channel } from "./classes/Channel.js"; import type { Emoji } from "./classes/Emoji.js"; import type { Message } from "./classes/Message.js"; import type { Server } from "./classes/Server.js"; import type { ServerMember } from "./classes/ServerMember.js"; -import type { User } from "./classes/User.js"; +import type { User, UserLimits } from "./classes/User.js"; import { AccountCollection } from "./collections/AccountCollection.js"; import { BotCollection } from "./collections/BotCollection.js"; import { ChannelCollection } from "./collections/ChannelCollection.js"; @@ -611,11 +611,14 @@ export class Client extends AsyncEventEmitter { this.#slowmodeTimers.set(channelId, timer); } - getLimits(): UserLimits | undefined { + /** + * Backend enforced limits for the logged in user + */ + get limits(): UserLimits | undefined { if (!this.configured() || !this.user) { return; } - return this.user.getLimits(); + return this.user.limits; } } diff --git a/src/classes/User.ts b/src/classes/User.ts index 91d07763..ab872a3d 100644 --- a/src/classes/User.ts +++ b/src/classes/User.ts @@ -1,8 +1,8 @@ import type { User as APIUser, + UserLimits as APIUserLimits, DataEditUser, Presence, - UserLimits, } from "stoat-api"; import { decodeTime } from "ulid"; @@ -14,6 +14,8 @@ import type { Channel } from "./Channel.js"; import type { File } from "./File.js"; import { UserProfile } from "./UserProfile.js"; +export type UserLimits = APIUserLimits; + /** * User Class */ @@ -347,7 +349,10 @@ export class User { ); } - getLimits(): UserLimits | undefined { + /** + * Backend enforced limits for a user + */ + get limits(): UserLimits | undefined { if (!this.#collection.client.configured()) { return; }