mirror of
https://github.com/stoatchat/javascript-client-sdk.git
synced 2026-07-19 17:13:31 -04:00
feat(messaging): add masquerade field
This commit is contained in:
+2
-2
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "revolt.js",
|
||||
"version": "5.1.0-alpha.6",
|
||||
"version": "5.1.0-alpha.7",
|
||||
"main": "dist/index.js",
|
||||
"repository": "https://github.com/revoltchat/revolt.js",
|
||||
"author": "Paul Makles <insrt.uk>",
|
||||
@@ -29,7 +29,7 @@
|
||||
"in-publish": "^2.0.1",
|
||||
"jsdoc-babel": "^0.5.0",
|
||||
"node-fetch": "^2.6.1",
|
||||
"revolt-api": "0.5.3-alpha.2",
|
||||
"revolt-api": "^0.5.3-alpha.8-patch.0",
|
||||
"rimraf": "^3.0.2",
|
||||
"tsc-watch": "^4.1.0",
|
||||
"typedoc": "^0.21.4",
|
||||
|
||||
@@ -14,6 +14,7 @@ export const ChannelPermission = {
|
||||
InviteOthers: 1 << 5,
|
||||
EmbedLinks: 1 << 6,
|
||||
UploadFiles: 1 << 7,
|
||||
Masquerade: 1 << 8,
|
||||
}
|
||||
|
||||
export const ServerPermission = {
|
||||
@@ -38,4 +39,5 @@ export const DEFAULT_PERMISSION_DM =
|
||||
+ ChannelPermission.VoiceCall
|
||||
+ ChannelPermission.InviteOthers
|
||||
+ ChannelPermission.EmbedLinks
|
||||
+ ChannelPermission.UploadFiles;
|
||||
+ ChannelPermission.UploadFiles
|
||||
+ ChannelPermission.Masquerade;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
export const LIBRARY_VERSION = '5.1.0-alpha.6';
|
||||
export const LIBRARY_VERSION = '5.1.0-alpha.7';
|
||||
|
||||
export const defaultConfig = {
|
||||
apiURL: 'https://api.revolt.chat',
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import type { Message as MessageI, SystemMessage } from 'revolt-api/types/Channels';
|
||||
import type { Masquerade, Message as MessageI, SystemMessage } from 'revolt-api/types/Channels';
|
||||
import type { Attachment } from 'revolt-api/types/Autumn';
|
||||
import type { Embed } from 'revolt-api/types/January';
|
||||
import type { Route } from '../api/routes';
|
||||
@@ -25,6 +25,7 @@ export class Message {
|
||||
embeds: Nullable<Embed[]>;
|
||||
mention_ids: Nullable<string[]>;
|
||||
reply_ids: Nullable<string[]>;
|
||||
masquerade: Nullable<Masquerade>;
|
||||
|
||||
get channel() {
|
||||
return this.client.channels.get(this.channel_id);
|
||||
@@ -55,6 +56,11 @@ export class Message {
|
||||
return decodeTime(this._id);
|
||||
}
|
||||
|
||||
@computed generateMasqAvatarURL() {
|
||||
const avatar = this.masquerade?.avatar;
|
||||
return avatar ? this.client.proxyFile(avatar) : undefined;
|
||||
}
|
||||
|
||||
@computed
|
||||
get asSystemMessage() {
|
||||
const content = this.content;
|
||||
@@ -89,6 +95,7 @@ export class Message {
|
||||
this.embeds = toNullable(data.embeds);
|
||||
this.mention_ids = toNullable(data.mentions);
|
||||
this.reply_ids = toNullable(data.replies);
|
||||
this.masquerade = toNullable(data.masquerade);
|
||||
|
||||
makeAutoObservable(this, {
|
||||
_id: false,
|
||||
|
||||
@@ -2005,10 +2005,10 @@ ret@~0.1.10:
|
||||
resolved "https://registry.yarnpkg.com/ret/-/ret-0.1.15.tgz#b8a4825d5bdb1fc3f6f53c2bc33f81388681c7bc"
|
||||
integrity sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==
|
||||
|
||||
revolt-api@0.5.3-alpha.2:
|
||||
version "0.5.3-alpha.2"
|
||||
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.3-alpha.2.tgz#b2ffcacbc0302c4876c2ca62e7c6ac088db4c053"
|
||||
integrity sha512-Fa1lARPJoey+8mlEml4fEJqr0H5zUmorLd8fEZ/boOB/JCSJU4/S6O3FKFLGp1FYadmpY4LGeETZlvuFbHADwg==
|
||||
revolt-api@^0.5.3-alpha.8-patch.0:
|
||||
version "0.5.3-alpha.8-patch.0"
|
||||
resolved "https://registry.yarnpkg.com/revolt-api/-/revolt-api-0.5.3-alpha.8-patch.0.tgz#3c9f981f8100a89aec1299bc110453cf01c51f89"
|
||||
integrity sha512-ghupcB1nJS7fCiD41L4u+QudFoBWGE381uW4s8cuHsQS3bFXgzAH1lgtjYNoFgrVUekqQAcHWote8Kn2sOABAQ==
|
||||
|
||||
rimraf@^3.0.2:
|
||||
version "3.0.2"
|
||||
|
||||
Reference in New Issue
Block a user