diff --git a/package.json b/package.json index 00262095..4b89279f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "revolt.js", - "version": "6.0.7", + "version": "6.0.8", "main": "dist/index.js", "typings": "dist/index.d.ts", "module": "esm/index.js", @@ -17,7 +17,7 @@ "lodash.isequal": "^4.5.0", "long": "^5.2.0", "mobx": "^6.3.2", - "revolt-api": "0.5.4", + "revolt-api": "0.5.5", "ulid": "^2.3.0", "ws": "^8.2.2" }, diff --git a/src/maps/Emojis.ts b/src/maps/Emojis.ts index 63510bca..20e03a8e 100644 --- a/src/maps/Emojis.ts +++ b/src/maps/Emojis.ts @@ -14,6 +14,7 @@ export class Emoji { creator_id: string; parent: EmojiParent; animated: boolean; + nsfw: boolean; /** * Get timestamp when this message was created. @@ -36,7 +37,8 @@ export class Emoji { this.name = data.name; this.creator_id = data.creator_id; this.parent = data.parent; - this.animated = data.animated; + this.animated = data.animated ?? false; + this.nsfw = data.nsfw ?? false; makeAutoObservable(this, { _id: false, diff --git a/src/maps/Messages.ts b/src/maps/Messages.ts index cc194b96..da8d759f 100644 --- a/src/maps/Messages.ts +++ b/src/maps/Messages.ts @@ -2,6 +2,7 @@ import type { DataEditMessage, DataMessageSend, Embed, + Interactions, Masquerade, Message as MessageI, SystemMessage, @@ -32,6 +33,8 @@ export class Message { mention_ids: Nullable; reply_ids: Nullable; masquerade: Nullable; + // reactions: Record>; + // interactions: Nullable; get channel() { return this.client.channels.get(this.channel_id); @@ -66,7 +69,7 @@ export class Message { * Absolute pathname to this message in the client. */ get path() { - return this.channel?.path + '/' + this._id; + return this.channel?.path + "/" + this._id; } /** @@ -84,7 +87,7 @@ export class Message { @computed get asSystemMessage() { const system = this.system; - if (!system) return { type: 'none' }; + if (!system) return { type: "none" }; const { type } = system; const get = (id: string) => this.client.users.get(id); @@ -163,12 +166,9 @@ export class Message { apply("mentions", "mention_ids"); } - @action append({ embeds }: Pick, 'embeds'>) { + @action append({ embeds }: Pick, "embeds">) { if (embeds) { - this.embeds = [ - ...(this.embeds ?? []), - ...embeds - ]; + this.embeds = [...(this.embeds ?? []), ...embeds]; } } @@ -178,7 +178,7 @@ export class Message { */ async edit(data: DataEditMessage) { return await this.client.api.patch( - `/channels/${this.channel_id as ''}/messages/${this._id as ''}`, + `/channels/${this.channel_id as ""}/messages/${this._id as ""}`, data, ); } @@ -188,7 +188,7 @@ export class Message { */ async delete() { return await this.client.api.delete( - `/channels/${this.channel_id as ''}/messages/${this._id as ''}`, + `/channels/${this.channel_id as ""}/messages/${this._id as ""}`, ); } diff --git a/yarn.lock b/yarn.lock index 01393114..ef96b7de 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1015,10 +1015,10 @@ reusify@^1.0.4: resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== -revolt-api@0.5.4: - version "0.5.4" - resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.4.tgz#cefbb05cbeeb7deb437aca9efb80ce277b8c04e4" - integrity sha512-JBoEzakPn11lq43BN2VMwyfeU8pC11Q6O07BuWjagMqBrjY8GdMdQIdmtmvudSiTogux6VsbGkV+0eVUUZ44xw== +revolt-api@0.5.5: + version "0.5.5" + resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.5.tgz#e4937822070fa3dd0940e9e22084f8ac5df3f1ce" + integrity sha512-aaXVqvDu6hWjrPoIUDSlMTdHLbWXfx5rlaycQwzevRizdPZRgsncEadvjfA90tB83N3oeVlKJTscLHbyQNO4QQ== dependencies: "@insertish/oapi" "0.1.16" axios "^0.26.1"