Fix message event double-send.

This commit is contained in:
Paul
2021-02-26 13:51:50 +00:00
parent d0b4ca46bd
commit 6380beb2e8
3 changed files with 3 additions and 2 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "revolt.js",
"version": "4.0.0-alpha.4",
"version": "4.0.0-alpha.5",
"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.4';
export const LIBRARY_VERSION = '4.0.0-alpha.5';
export const defaultConfig = {
apiURL: 'https://api.revolt.chat',
+1
View File
@@ -58,6 +58,7 @@ export default class Channels extends Collection<Channel> {
this.getThrow(id);
let message = await this.client.req<'POST', '/channels/:id/messages'>('POST', `/channels/${id}/messages` as any, data);
if (!this.client.messages.includes(id)) {
this.client.messages.push(id);
this.client.emit('message', message);
}
return message;