Fix opening existing DM.

This commit is contained in:
Paul
2021-03-02 09:40:49 +00:00
parent cb7029dd53
commit 38ebbc2967
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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 <insrt.uk>",
+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.12';
export const LIBRARY_VERSION = '4.0.0-alpha.13';
export const defaultConfig = {
apiURL: 'https://api.revolt.chat',
+1 -1
View File
@@ -23,7 +23,7 @@ export default class Users extends Collection<User> {
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);