From 38ebbc29674ff040d38faca046481500727a4bc3 Mon Sep 17 00:00:00 2001 From: Paul Date: Tue, 2 Mar 2021 09:40:49 +0000 Subject: [PATCH] Fix opening existing DM. --- package.json | 2 +- src/index.ts | 2 +- src/maps/Users.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index 58ebb3ed..42369da2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt.js", - "version": "4.0.0-alpha.12", + "version": "4.0.0-alpha.13", "main": "dist/index.js", "repository": "https://gitlab.insrt.uk/revolt/revolt.js", "author": "Paul Makles ", diff --git a/src/index.ts b/src/index.ts index 32b7a56f..288da788 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.12'; +export const LIBRARY_VERSION = '4.0.0-alpha.13'; export const defaultConfig = { apiURL: 'https://api.revolt.chat', diff --git a/src/maps/Users.ts b/src/maps/Users.ts index 7e6bc63b..e17c19ad 100644 --- a/src/maps/Users.ts +++ b/src/maps/Users.ts @@ -23,7 +23,7 @@ export default class Users extends Collection { let channel = this.client.channels .toArray() .find(channel => channel.channel_type === 'DirectMessage' - && channel.recipients.find(user => user !== this.client.user?._id)); + && channel.recipients.find(user => user === id)); if (typeof channel === 'undefined') { channel = await this.client.req<'GET', '/users/:id/dm'>('GET', `/users/${id}/dm` as any);