mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-25 00:15:26 -04:00
Fix fetchMessage being called with undefined id.
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "revolt.js",
|
||||
"version": "3.0.1-beta.13",
|
||||
"version": "3.0.1-beta.14",
|
||||
"main": "dist/index.js",
|
||||
"repository": "https://gitlab.insrt.uk/revolt/revolt.js",
|
||||
"author": "Paul Makles <insrt.uk>",
|
||||
|
||||
+1
-1
@@ -12,7 +12,7 @@ export const API_VERSION = {
|
||||
};
|
||||
|
||||
export const LIBRARY_VERSION = {
|
||||
str: '3.0.1',
|
||||
str: '3.0.1-beta.14',
|
||||
major: 3,
|
||||
minor: 0,
|
||||
patch: 1
|
||||
|
||||
@@ -82,9 +82,9 @@ export default abstract class Channel {
|
||||
}
|
||||
|
||||
async sendMessage(content: string, nonce: string = ulid()) {
|
||||
let res = await this.client.Axios.post(`/channels/${this.id}/messages`, { content, nonce });
|
||||
let fire = !this.client.messages.has(res.data.id);
|
||||
let message = await this.fetchMessage(res.data.id, res.data);
|
||||
let res = await this.client.Axios.post(`/channels/${this.id}/messages`, { content, nonce }) as { data: Channels.Message };
|
||||
let fire = !this.client.messages.has(res.data._id);
|
||||
let message = await this.fetchMessage(res.data._id, res.data);
|
||||
fire && this.client.emit('message', message);
|
||||
return message;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user