revolt.js
Advanced tools
Comparing version 6.0.3 to 6.0.4
@@ -11,2 +11,3 @@ import EventEmitter from "eventemitter3"; | ||
import Users, { User } from "./maps/Users"; | ||
import Emojis, { Emoji } from "./maps/Emojis"; | ||
import { WebSocketClient } from "./websocket/client"; | ||
@@ -61,2 +62,4 @@ import { ClientboundNotification } from "./websocket/notifications"; | ||
on(event: "user/relationship", listener: (user: User) => void): this; | ||
on(event: "emoji/create", listener: (emoji: Emoji) => void): this; | ||
on(event: "emoji/delete", listener: (id: string, emoji?: Emoji) => void): this; | ||
} | ||
@@ -95,2 +98,3 @@ /** | ||
bots: Bots; | ||
emojis: Emojis; | ||
unreads?: Unreads; | ||
@@ -97,0 +101,0 @@ constructor(options?: Partial<ClientOptions>); |
@@ -26,2 +26,3 @@ "use strict"; | ||
const Users_1 = __importDefault(require("./maps/Users")); | ||
const Emojis_1 = __importDefault(require("./maps/Emojis")); | ||
const client_1 = require("./websocket/client"); | ||
@@ -48,2 +49,3 @@ const config_1 = require("./config"); | ||
this.bots = new Bots_1.default(this); | ||
this.emojis = new Emojis_1.default(this); | ||
(0, mobx_1.makeObservable)(this, { | ||
@@ -56,2 +58,3 @@ user: mobx_1.observable, | ||
messages: mobx_1.observable, | ||
emojis: mobx_1.observable, | ||
reset: mobx_1.action, | ||
@@ -312,2 +315,3 @@ }, { | ||
this.messages = new Messages_1.default(this); | ||
this.emojis = new Emojis_1.default(this); | ||
} | ||
@@ -314,0 +318,0 @@ /** |
@@ -6,2 +6,3 @@ export { Channel } from "./maps/Channels"; | ||
export { User } from "./maps/Users"; | ||
export { Emoji } from "./maps/Emojis"; | ||
export * from "./Client"; | ||
@@ -8,0 +9,0 @@ export * from "./config"; |
@@ -25,3 +25,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.API = exports.toNullableDate = exports.toNullable = exports.calculatePermission = exports.U32_MAX = exports.DEFAULT_PERMISSION_VIEW_ONLY = exports.DEFAULT_PERMISSION_SERVER = exports.DEFAULT_PERMISSION_SAVED_MESSAGES = exports.DEFAULT_PERMISSION_DIRECT_MESSAGE = exports.DEFAULT_PERMISSION = exports.Permission = exports.UserPermission = exports.User = exports.Server = exports.Message = exports.Member = exports.Channel = void 0; | ||
exports.API = exports.toNullableDate = exports.toNullable = exports.calculatePermission = exports.U32_MAX = exports.DEFAULT_PERMISSION_VIEW_ONLY = exports.DEFAULT_PERMISSION_SERVER = exports.DEFAULT_PERMISSION_SAVED_MESSAGES = exports.DEFAULT_PERMISSION_DIRECT_MESSAGE = exports.DEFAULT_PERMISSION = exports.Permission = exports.UserPermission = exports.Emoji = exports.User = exports.Server = exports.Message = exports.Member = exports.Channel = void 0; | ||
var Channels_1 = require("./maps/Channels"); | ||
@@ -37,2 +37,4 @@ Object.defineProperty(exports, "Channel", { enumerable: true, get: function () { return Channels_1.Channel; } }); | ||
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return Users_1.User; } }); | ||
var Emojis_1 = require("./maps/Emojis"); | ||
Object.defineProperty(exports, "Emoji", { enumerable: true, get: function () { return Emojis_1.Emoji; } }); | ||
__exportStar(require("./Client"), exports); | ||
@@ -39,0 +41,0 @@ __exportStar(require("./config"), exports); |
@@ -403,2 +403,11 @@ import type { Category, Channel as ChannelI, DataBanCreate, DataCreateChannel, DataCreateServer, DataEditRole, DataEditServer, FieldsServer, Role, Server as ServerI, SystemMessageChannels } from "revolt-api"; | ||
online?: boolean | null | undefined; | ||
} | { | ||
_id: string; | ||
parent: { | ||
type: "Server"; | ||
id: string; | ||
}; | ||
creator_id: string; | ||
name: string; | ||
animated: boolean; | ||
} | undefined>; | ||
@@ -405,0 +414,0 @@ /** |
@@ -132,2 +132,5 @@ "use strict"; | ||
} | ||
for (const emoji of packet.emojis) { | ||
this.client.emojis.createObj(emoji); | ||
} | ||
}); | ||
@@ -421,2 +424,11 @@ this.client.user = this.client.users.get(packet.users.find((x) => x.relationship === "User")._id); | ||
} | ||
case "EmojiCreate": { | ||
this.client.emojis.createObj(packet, true); | ||
break; | ||
} | ||
case "EmojiDelete": { | ||
const emoji = this.client.emojis.get(packet.id); | ||
this.client.emit("emoji/delete", packet.id, emoji); | ||
break; | ||
} | ||
case "Pong": { | ||
@@ -423,0 +435,0 @@ this.ping = +new Date() - packet.data; |
@@ -1,2 +0,2 @@ | ||
import type { FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
import type { Emoji, FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
import type { Channel, Message } from "revolt-api"; | ||
@@ -32,2 +32,3 @@ import type { Member, MemberCompositeKey, Role, Server } from "revolt-api"; | ||
members: Member[]; | ||
emojis?: Emoji[]; | ||
}; | ||
@@ -152,3 +153,8 @@ export declare type ClientboundNotification = { | ||
}; | ||
} | ({ | ||
type: "EmojiCreate"; | ||
} & Emoji) | { | ||
type: "EmojiDelete"; | ||
id: string; | ||
}; | ||
export {}; |
@@ -11,2 +11,3 @@ import EventEmitter from "eventemitter3"; | ||
import Users, { User } from "./maps/Users"; | ||
import Emojis, { Emoji } from "./maps/Emojis"; | ||
import { WebSocketClient } from "./websocket/client"; | ||
@@ -61,2 +62,4 @@ import { ClientboundNotification } from "./websocket/notifications"; | ||
on(event: "user/relationship", listener: (user: User) => void): this; | ||
on(event: "emoji/create", listener: (emoji: Emoji) => void): this; | ||
on(event: "emoji/delete", listener: (id: string, emoji?: Emoji) => void): this; | ||
} | ||
@@ -95,2 +98,3 @@ /** | ||
bots: Bots; | ||
emojis: Emojis; | ||
unreads?: Unreads; | ||
@@ -97,0 +101,0 @@ constructor(options?: Partial<ClientOptions>); |
@@ -20,2 +20,3 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
import Users from "./maps/Users"; | ||
import Emojis from "./maps/Emojis"; | ||
import { WebSocketClient } from "./websocket/client"; | ||
@@ -42,2 +43,3 @@ import { defaultConfig } from "./config"; | ||
this.bots = new Bots(this); | ||
this.emojis = new Emojis(this); | ||
makeObservable(this, { | ||
@@ -50,2 +52,3 @@ user: observable, | ||
messages: observable, | ||
emojis: observable, | ||
reset: action, | ||
@@ -306,2 +309,3 @@ }, { | ||
this.messages = new Messages(this); | ||
this.emojis = new Emojis(this); | ||
} | ||
@@ -308,0 +312,0 @@ /** |
@@ -6,2 +6,3 @@ export { Channel } from "./maps/Channels"; | ||
export { User } from "./maps/Users"; | ||
export { Emoji } from "./maps/Emojis"; | ||
export * from "./Client"; | ||
@@ -8,0 +9,0 @@ export * from "./config"; |
@@ -6,2 +6,3 @@ export { Channel } from "./maps/Channels"; | ||
export { User } from "./maps/Users"; | ||
export { Emoji } from "./maps/Emojis"; | ||
export * from "./Client"; | ||
@@ -8,0 +9,0 @@ export * from "./config"; |
@@ -403,2 +403,11 @@ import type { Category, Channel as ChannelI, DataBanCreate, DataCreateChannel, DataCreateServer, DataEditRole, DataEditServer, FieldsServer, Role, Server as ServerI, SystemMessageChannels } from "revolt-api"; | ||
online?: boolean | null | undefined; | ||
} | { | ||
_id: string; | ||
parent: { | ||
type: "Server"; | ||
id: string; | ||
}; | ||
creator_id: string; | ||
name: string; | ||
animated: boolean; | ||
} | undefined>; | ||
@@ -405,0 +414,0 @@ /** |
@@ -126,2 +126,5 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
} | ||
for (const emoji of packet.emojis) { | ||
this.client.emojis.createObj(emoji); | ||
} | ||
}); | ||
@@ -415,2 +418,11 @@ this.client.user = this.client.users.get(packet.users.find((x) => x.relationship === "User")._id); | ||
} | ||
case "EmojiCreate": { | ||
this.client.emojis.createObj(packet, true); | ||
break; | ||
} | ||
case "EmojiDelete": { | ||
const emoji = this.client.emojis.get(packet.id); | ||
this.client.emit("emoji/delete", packet.id, emoji); | ||
break; | ||
} | ||
case "Pong": { | ||
@@ -417,0 +429,0 @@ this.ping = +new Date() - packet.data; |
@@ -1,2 +0,2 @@ | ||
import type { FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
import type { Emoji, FieldsChannel, FieldsMember, FieldsServer, FieldsUser } from "revolt-api"; | ||
import type { Channel, Message } from "revolt-api"; | ||
@@ -32,2 +32,3 @@ import type { Member, MemberCompositeKey, Role, Server } from "revolt-api"; | ||
members: Member[]; | ||
emojis?: Emoji[]; | ||
}; | ||
@@ -152,3 +153,8 @@ export declare type ClientboundNotification = { | ||
}; | ||
} | ({ | ||
type: "EmojiCreate"; | ||
} & Emoji) | { | ||
type: "EmojiDelete"; | ||
id: string; | ||
}; | ||
export {}; |
{ | ||
"name": "revolt.js", | ||
"version": "6.0.3", | ||
"version": "6.0.4", | ||
"main": "dist/index.js", | ||
@@ -20,3 +20,3 @@ "typings": "dist/index.d.ts", | ||
"mobx": "^6.3.2", | ||
"revolt-api": "0.5.3-7", | ||
"revolt-api": "0.5.4", | ||
"ulid": "^2.3.0", | ||
@@ -48,4 +48,8 @@ "ws": "^8.2.2" | ||
"parser": "@typescript-eslint/parser", | ||
"plugins": [ | ||
"mobx" | ||
], | ||
"extends": [ | ||
"plugin:@typescript-eslint/recommended" | ||
"plugin:@typescript-eslint/recommended", | ||
"plugin:mobx/recommended" | ||
], | ||
@@ -52,0 +56,0 @@ "ignorePatterns": [ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
471850
75
13153
+ Addedrevolt-api@0.5.4(transitive)
- Removedrevolt-api@0.5.3-7(transitive)
Updatedrevolt-api@0.5.4