mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-20 20:16:06 -04:00
fix: create system user on collection creation
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "revolt.js",
|
||||
"version": "7.0.0-beta.3",
|
||||
"version": "7.0.0-beta.4",
|
||||
"main": "lib/cjs/index.js",
|
||||
"module": "lib/esm/index.js",
|
||||
"types": "src/index.ts",
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { API, User } from "..";
|
||||
import { API, Client, User } from "..";
|
||||
import { HydratedUser } from "../hydration";
|
||||
|
||||
import { ClassCollection } from ".";
|
||||
@@ -7,6 +7,19 @@ import { ClassCollection } from ".";
|
||||
* Collection of Users
|
||||
*/
|
||||
export class UserCollection extends ClassCollection<User, HydratedUser> {
|
||||
/**
|
||||
* Construct User collection
|
||||
*/
|
||||
constructor(client: Client) {
|
||||
super(client);
|
||||
|
||||
const SYSTEM_ID = "0".repeat(26);
|
||||
this.getOrCreate(SYSTEM_ID, {
|
||||
_id: SYSTEM_ID,
|
||||
username: "Revolt",
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch user by ID
|
||||
* @param id Id
|
||||
|
||||
Reference in New Issue
Block a user