Fix restore();

This commit is contained in:
Paul
2021-02-25 18:56:47 +00:00
parent bc5b6a79df
commit d0b4ca46bd
4 changed files with 6 additions and 7 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "revolt.js",
"version": "4.0.0-alpha.3",
"version": "4.0.0-alpha.4",
"main": "dist/index.js",
"repository": "https://gitlab.insrt.uk/revolt/revolt.js",
"author": "Paul Makles <insrt.uk>",
+4
View File
@@ -94,6 +94,10 @@ export class Client extends EventEmitter {
async restore(user_id?: string) {
await this.users.restore(user => { return { ...user, online: false } });
await this.channels.restore();
this.users.set({
_id: '00000000000000000000000000',
username: 'revolt'
});
if (user_id) this.user = this.users.get(user_id);
}
+1 -1
View File
@@ -1,7 +1,7 @@
export * from './Client';
export { Channel, User, Message } from './api/objects';
export const LIBRARY_VERSION = '4.0.0-alpha.3';
export const LIBRARY_VERSION = '4.0.0-alpha.4';
export const defaultConfig = {
apiURL: 'https://api.revolt.chat',
-5
View File
@@ -5,11 +5,6 @@ import { Client } from '..';
export default class Users extends Collection<User> {
constructor(client: Client) {
super(client, 'users');
this.set({
_id: '00000000000000000000000000',
username: 'revolt'
});
}
async fetchMutable(id: string) {