From d0b4ca46bda4d06ec4a53252f34a35dc7ba407da Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 25 Feb 2021 18:56:47 +0000 Subject: [PATCH] Fix restore(); --- package.json | 2 +- src/Client.ts | 4 ++++ src/index.ts | 2 +- src/maps/Users.ts | 5 ----- 4 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package.json b/package.json index 183cbfd6..3a1702bd 100644 --- a/package.json +++ b/package.json @@ -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 ", diff --git a/src/Client.ts b/src/Client.ts index 543abb34..b1d05fbd 100644 --- a/src/Client.ts +++ b/src/Client.ts @@ -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); } diff --git a/src/index.ts b/src/index.ts index a7014967..1101a2ad 100644 --- a/src/index.ts +++ b/src/index.ts @@ -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', diff --git a/src/maps/Users.ts b/src/maps/Users.ts index 0a309ca7..6d4dacdb 100644 --- a/src/maps/Users.ts +++ b/src/maps/Users.ts @@ -5,11 +5,6 @@ import { Client } from '..'; export default class Users extends Collection { constructor(client: Client) { super(client, 'users'); - - this.set({ - _id: '00000000000000000000000000', - username: 'revolt' - }); } async fetchMutable(id: string) {