mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-20 20:16:06 -04:00
Fix opening existing DM.
This commit is contained in:
+1
-1
@@ -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
@@ -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
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user