revbot.js 0.0.2 → 0.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2450 -0
- package/dist/index.d.ts +2450 -0
- package/dist/index.js +4127 -22
- package/dist/index.mjs +4055 -0
- package/package.json +1 -1
- package/dist/client/baseClient.js +0 -66
- package/dist/client/baseClient.js.map +0 -1
- package/dist/client/client.js +0 -120
- package/dist/client/client.js.map +0 -1
- package/dist/client/events/bulkMessageDelete.js +0 -22
- package/dist/client/events/bulkMessageDelete.js.map +0 -1
- package/dist/client/events/channelCreate.js +0 -42
- package/dist/client/events/channelCreate.js.map +0 -1
- package/dist/client/events/channelDelete.js +0 -30
- package/dist/client/events/channelDelete.js.map +0 -1
- package/dist/client/events/channelGroupJoin.js +0 -39
- package/dist/client/events/channelGroupJoin.js.map +0 -1
- package/dist/client/events/channelGroupLeave.js +0 -39
- package/dist/client/events/channelGroupLeave.js.map +0 -1
- package/dist/client/events/channelStarttyping.js +0 -27
- package/dist/client/events/channelStarttyping.js.map +0 -1
- package/dist/client/events/channelStopTyping.js +0 -27
- package/dist/client/events/channelStopTyping.js.map +0 -1
- package/dist/client/events/channelUpdate.js +0 -26
- package/dist/client/events/channelUpdate.js.map +0 -1
- package/dist/client/events/event.js +0 -21
- package/dist/client/events/event.js.map +0 -1
- package/dist/client/events/eventManager.js +0 -82
- package/dist/client/events/eventManager.js.map +0 -1
- package/dist/client/events/index.js +0 -39
- package/dist/client/events/index.js.map +0 -1
- package/dist/client/events/message.js +0 -43
- package/dist/client/events/message.js.map +0 -1
- package/dist/client/events/messageDelete.js +0 -31
- package/dist/client/events/messageDelete.js.map +0 -1
- package/dist/client/events/messageReact.js +0 -47
- package/dist/client/events/messageReact.js.map +0 -1
- package/dist/client/events/messageUnreact.js +0 -52
- package/dist/client/events/messageUnreact.js.map +0 -1
- package/dist/client/events/messageUpdate.js +0 -29
- package/dist/client/events/messageUpdate.js.map +0 -1
- package/dist/client/events/serverCreate.js +0 -37
- package/dist/client/events/serverCreate.js.map +0 -1
- package/dist/client/events/serverDelete.js +0 -27
- package/dist/client/events/serverDelete.js.map +0 -1
- package/dist/client/events/serverMemberJoin.js +0 -41
- package/dist/client/events/serverMemberJoin.js.map +0 -1
- package/dist/client/events/serverMemberLeave.js +0 -31
- package/dist/client/events/serverMemberLeave.js.map +0 -1
- package/dist/client/events/serverMemberUpdate.js +0 -45
- package/dist/client/events/serverMemberUpdate.js.map +0 -1
- package/dist/client/events/serverRoleDelete.js +0 -31
- package/dist/client/events/serverRoleDelete.js.map +0 -1
- package/dist/client/events/serverRoleUpdate.js +0 -29
- package/dist/client/events/serverRoleUpdate.js.map +0 -1
- package/dist/client/events/serverupdate.js +0 -26
- package/dist/client/events/serverupdate.js.map +0 -1
- package/dist/client/events/userUpdate.js +0 -28
- package/dist/client/events/userUpdate.js.map +0 -1
- package/dist/client/webSocket.js +0 -285
- package/dist/client/webSocket.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/managers/baseManager.js +0 -44
- package/dist/managers/baseManager.js.map +0 -1
- package/dist/managers/channelManager.js +0 -113
- package/dist/managers/channelManager.js.map +0 -1
- package/dist/managers/index.js +0 -25
- package/dist/managers/index.js.map +0 -1
- package/dist/managers/messageManager.js +0 -218
- package/dist/managers/messageManager.js.map +0 -1
- package/dist/managers/roleManager.js +0 -52
- package/dist/managers/roleManager.js.map +0 -1
- package/dist/managers/serverChannelManager.js +0 -81
- package/dist/managers/serverChannelManager.js.map +0 -1
- package/dist/managers/serverManager.js +0 -72
- package/dist/managers/serverManager.js.map +0 -1
- package/dist/managers/serverMemberManager.js +0 -128
- package/dist/managers/serverMemberManager.js.map +0 -1
- package/dist/managers/userManager.js +0 -56
- package/dist/managers/userManager.js.map +0 -1
- package/dist/rest/restClient.js +0 -113
- package/dist/rest/restClient.js.map +0 -1
- package/dist/rest/restUtils/queue.js +0 -22
- package/dist/rest/restUtils/queue.js.map +0 -1
- package/dist/struct/attachment.js +0 -42
- package/dist/struct/attachment.js.map +0 -1
- package/dist/struct/base.js +0 -88
- package/dist/struct/base.js.map +0 -1
- package/dist/struct/category.js +0 -65
- package/dist/struct/category.js.map +0 -1
- package/dist/struct/channel.js +0 -111
- package/dist/struct/channel.js.map +0 -1
- package/dist/struct/clientUser.js +0 -69
- package/dist/struct/clientUser.js.map +0 -1
- package/dist/struct/dmChannel.js +0 -87
- package/dist/struct/dmChannel.js.map +0 -1
- package/dist/struct/emoji.js +0 -49
- package/dist/struct/emoji.js.map +0 -1
- package/dist/struct/groupChannel.js +0 -203
- package/dist/struct/groupChannel.js.map +0 -1
- package/dist/struct/index.js +0 -37
- package/dist/struct/index.js.map +0 -1
- package/dist/struct/interfaces/baseChannel.js +0 -3
- package/dist/struct/interfaces/baseChannel.js.map +0 -1
- package/dist/struct/invite.js +0 -67
- package/dist/struct/invite.js.map +0 -1
- package/dist/struct/mentions.js +0 -86
- package/dist/struct/mentions.js.map +0 -1
- package/dist/struct/message.js +0 -249
- package/dist/struct/message.js.map +0 -1
- package/dist/struct/messageEmbed.js +0 -106
- package/dist/struct/messageEmbed.js.map +0 -1
- package/dist/struct/notesChannel.js +0 -92
- package/dist/struct/notesChannel.js.map +0 -1
- package/dist/struct/presence.js +0 -30
- package/dist/struct/presence.js.map +0 -1
- package/dist/struct/role.js +0 -107
- package/dist/struct/role.js.map +0 -1
- package/dist/struct/server.js +0 -164
- package/dist/struct/server.js.map +0 -1
- package/dist/struct/serverChannel.js +0 -118
- package/dist/struct/serverChannel.js.map +0 -1
- package/dist/struct/serverMember.js +0 -205
- package/dist/struct/serverMember.js.map +0 -1
- package/dist/struct/textChannel.js +0 -83
- package/dist/struct/textChannel.js.map +0 -1
- package/dist/struct/user.js +0 -172
- package/dist/struct/user.js.map +0 -1
- package/dist/struct/voiceChannels.js +0 -54
- package/dist/struct/voiceChannels.js.map +0 -1
- package/dist/test.js +0 -42
- package/dist/test.js.map +0 -1
- package/dist/utils/UUID.js +0 -53
- package/dist/utils/UUID.js.map +0 -1
- package/dist/utils/badges.js +0 -22
- package/dist/utils/badges.js.map +0 -1
- package/dist/utils/bitField.js +0 -79
- package/dist/utils/bitField.js.map +0 -1
- package/dist/utils/constants.js +0 -105
- package/dist/utils/constants.js.map +0 -1
- package/dist/utils/index.js +0 -22
- package/dist/utils/index.js.map +0 -1
- package/dist/utils/permissions.js +0 -68
- package/dist/utils/permissions.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __classPrivateFieldSet = (this && this.__classPrivateFieldSet) || function (receiver, state, value, kind, f) {
|
|
3
|
-
if (kind === "m") throw new TypeError("Private method is not writable");
|
|
4
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a setter");
|
|
5
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
6
|
-
return (kind === "a" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;
|
|
7
|
-
};
|
|
8
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
9
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
10
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
11
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
12
|
-
};
|
|
13
|
-
var _BaseClient_token;
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.BaseClient = void 0;
|
|
16
|
-
const node_events_1 = require("node:events");
|
|
17
|
-
const constants_1 = require("../utils/constants");
|
|
18
|
-
const restClient_1 = require("../rest/restClient");
|
|
19
|
-
/**
|
|
20
|
-
* Represents the base client that provides core functionality for interacting with the API.
|
|
21
|
-
*
|
|
22
|
-
* @extends EventEmitter
|
|
23
|
-
*/
|
|
24
|
-
class BaseClient extends node_events_1.EventEmitter {
|
|
25
|
-
/**
|
|
26
|
-
* Creates a new BaseClient instance.
|
|
27
|
-
*
|
|
28
|
-
* @param {clientOptions} [options={}] - The options for configuring the client.
|
|
29
|
-
*/
|
|
30
|
-
constructor(options = {}) {
|
|
31
|
-
super();
|
|
32
|
-
/** The authentication token for the client. */
|
|
33
|
-
_BaseClient_token.set(this, null);
|
|
34
|
-
/** Whether the client is a bot. */
|
|
35
|
-
this.bot = true;
|
|
36
|
-
this.options = Object.assign({}, options);
|
|
37
|
-
this.api = new restClient_1.RestClient(this);
|
|
38
|
-
}
|
|
39
|
-
/**
|
|
40
|
-
* Emits a debug message.
|
|
41
|
-
*
|
|
42
|
-
* @param {unknown} msg - The debug message to emit.
|
|
43
|
-
*/
|
|
44
|
-
debug(msg) {
|
|
45
|
-
this.emit(constants_1.Events.DEBUG, msg);
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Sets the authentication token for the client.
|
|
49
|
-
*
|
|
50
|
-
* @param {string | null} token - The authentication token.
|
|
51
|
-
*/
|
|
52
|
-
set token(token) {
|
|
53
|
-
__classPrivateFieldSet(this, _BaseClient_token, token, "f");
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Gets the authentication token for the client.
|
|
57
|
-
*
|
|
58
|
-
* @returns {string | null} The authentication token, or `null` if not set.
|
|
59
|
-
*/
|
|
60
|
-
get token() {
|
|
61
|
-
return __classPrivateFieldGet(this, _BaseClient_token, "f");
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
exports.BaseClient = BaseClient;
|
|
65
|
-
_BaseClient_token = new WeakMap();
|
|
66
|
-
//# sourceMappingURL=baseClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"baseClient.js","sourceRoot":"","sources":["../../src/client/baseClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAOA,6CAA2C;AAC3C,kDAA4C;AAC5C,mDAAgD;AAoIhD;;;;GAIG;AACH,MAAsB,UAAW,SAAQ,0BAAY;IAanD;;;;OAIG;IACH,YAAY,UAAyB,EAAE;QACrC,KAAK,EAAE,CAAC;QAfV,+CAA+C;QAC/C,4BAAwB,IAAI,EAAC;QAK7B,mCAAmC;QACnC,QAAG,GAAG,IAAI,CAAC;QAST,IAAI,CAAC,OAAO,qBACP,OAAO,CACX,CAAC;QACF,IAAI,CAAC,GAAG,GAAG,IAAI,uBAAU,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,GAAY;QAChB,IAAI,CAAC,IAAI,CAAC,kBAAM,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IAC/B,CAAC;IAED;;;;OAIG;IACH,IAAI,KAAK,CAAC,KAAoB;QAC5B,uBAAA,IAAI,qBAAU,KAAK,MAAA,CAAC;IACtB,CAAC;IAED;;;;OAIG;IACH,IAAI,KAAK;QACP,OAAO,uBAAA,IAAI,yBAAO,CAAC;IACrB,CAAC;CACF;AApDD,gCAoDC"}
|
package/dist/client/client.js
DELETED
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.client = void 0;
|
|
13
|
-
const managers_1 = require("../managers");
|
|
14
|
-
const userManager_1 = require("../managers/userManager");
|
|
15
|
-
const baseClient_1 = require("./baseClient");
|
|
16
|
-
const eventManager_1 = require("./events/eventManager");
|
|
17
|
-
const webSocket_1 = require("./webSocket");
|
|
18
|
-
/**
|
|
19
|
-
* Represents the main client for interacting with the API.
|
|
20
|
-
*
|
|
21
|
-
* @extends BaseClient
|
|
22
|
-
*/
|
|
23
|
-
class client extends baseClient_1.BaseClient {
|
|
24
|
-
constructor() {
|
|
25
|
-
super(...arguments);
|
|
26
|
-
/** The WebSocket client used for real-time communication. */
|
|
27
|
-
this.ws = new webSocket_1.WebSocketClient(this);
|
|
28
|
-
/** Manages the channels in the client. */
|
|
29
|
-
this.channels = new managers_1.ChannelManager(this);
|
|
30
|
-
/** Manages the servers in the client. */
|
|
31
|
-
this.servers = new managers_1.ServerManager(this);
|
|
32
|
-
/** Manages the users in the client. */
|
|
33
|
-
this.users = new userManager_1.UserManager(this);
|
|
34
|
-
/** Manages the events in the client. */
|
|
35
|
-
this.events = new eventManager_1.EventManager(this);
|
|
36
|
-
/** The authenticated user, or `null` if not logged in. */
|
|
37
|
-
this.user = null;
|
|
38
|
-
/** The timestamp when the client became ready, or `null` if not ready. */
|
|
39
|
-
this.readyAt = null;
|
|
40
|
-
}
|
|
41
|
-
/**
|
|
42
|
-
* Gets the timestamp when the client became ready.
|
|
43
|
-
*
|
|
44
|
-
* @returns {number | null} The ready timestamp in milliseconds, or `null` if not ready.
|
|
45
|
-
*/
|
|
46
|
-
get readyTimestamp() {
|
|
47
|
-
return this.readyAt ? this.readyAt.getTime() : null;
|
|
48
|
-
}
|
|
49
|
-
/**
|
|
50
|
-
* Gets the uptime of the client in milliseconds.
|
|
51
|
-
*
|
|
52
|
-
* @returns {number | null} The uptime in milliseconds, or `null` if the client is not ready.
|
|
53
|
-
*/
|
|
54
|
-
get upTime() {
|
|
55
|
-
return this.readyAt ? Date.now() - this.readyAt.getTime() : null;
|
|
56
|
-
}
|
|
57
|
-
/**
|
|
58
|
-
* Logs the client into the API using the provided token.
|
|
59
|
-
*
|
|
60
|
-
* @param {string} token - The authentication token.
|
|
61
|
-
* @returns {Promise<void>} A promise that resolves when the client is logged in.
|
|
62
|
-
* @throws {Error} Throws an error if the token is not provided or if the WebSocket connection fails.
|
|
63
|
-
*
|
|
64
|
-
* @example
|
|
65
|
-
* ```typescript
|
|
66
|
-
* await client.login("your-token-here");
|
|
67
|
-
* ```
|
|
68
|
-
*/
|
|
69
|
-
login(token) {
|
|
70
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
71
|
-
if (!token)
|
|
72
|
-
throw new Error("Token is required");
|
|
73
|
-
this.token = token;
|
|
74
|
-
this.debug("Logging in...");
|
|
75
|
-
try {
|
|
76
|
-
yield this.ws.connect();
|
|
77
|
-
}
|
|
78
|
-
catch (error) {
|
|
79
|
-
this.debug(`Error connecting to WebSocket: ${error}`);
|
|
80
|
-
throw error;
|
|
81
|
-
}
|
|
82
|
-
this.readyAt = new Date();
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Destroys the client, disconnecting it from the API and clearing its state.
|
|
87
|
-
*
|
|
88
|
-
* @returns {Promise<void>} A promise that resolves when the client is destroyed.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```typescript
|
|
92
|
-
* await client.destroy();
|
|
93
|
-
* ```
|
|
94
|
-
*/
|
|
95
|
-
destroy() {
|
|
96
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
this.token = null;
|
|
98
|
-
this.user = null;
|
|
99
|
-
this.readyAt = null;
|
|
100
|
-
yield this.ws.destroy();
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
/**
|
|
104
|
-
* Checks if the client is ready.
|
|
105
|
-
*
|
|
106
|
-
* @returns {boolean} `true` if the client is ready, otherwise `false`.
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
* ```typescript
|
|
110
|
-
* if (client.isReady()) {
|
|
111
|
-
* console.log("Client is ready!");
|
|
112
|
-
* }
|
|
113
|
-
* ```
|
|
114
|
-
*/
|
|
115
|
-
isReady() {
|
|
116
|
-
return this.readyAt !== null;
|
|
117
|
-
}
|
|
118
|
-
}
|
|
119
|
-
exports.client = client;
|
|
120
|
-
//# sourceMappingURL=client.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/client/client.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,0CAA4D;AAC5D,yDAAsD;AAEtD,6CAA0C;AAC1C,wDAAqD;AACrD,2CAA8C;AAE9C;;;;GAIG;AACH,MAAa,MAAO,SAAQ,uBAAU;IAAtC;;QACE,6DAA6D;QAC1C,OAAE,GAAG,IAAI,2BAAe,CAAC,IAAI,CAAC,CAAC;QAElD,0CAA0C;QACjC,aAAQ,GAAG,IAAI,yBAAc,CAAC,IAAI,CAAC,CAAC;QAE7C,yCAAyC;QAChC,YAAO,GAAG,IAAI,wBAAa,CAAC,IAAI,CAAC,CAAC;QAE3C,uCAAuC;QAC9B,UAAK,GAAG,IAAI,yBAAW,CAAC,IAAI,CAAC,CAAC;QAEvC,wCAAwC;QAC/B,WAAM,GAAG,IAAI,2BAAY,CAAC,IAAI,CAAC,CAAC;QAEzC,0DAA0D;QAC1D,SAAI,GAAsB,IAAI,CAAC;QAE/B,0EAA0E;QAC1E,YAAO,GAAgB,IAAI,CAAC;IAgF9B,CAAC;IA9EC;;;;OAIG;IACH,IAAI,cAAc;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACtD,CAAC;IAED;;;;OAIG;IACH,IAAI,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IACnE,CAAC;IAED;;;;;;;;;;;OAWG;IACG,KAAK,CAAC,KAAa;;YACvB,IAAI,CAAC,KAAK;gBAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;YAEjD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;YAEnB,IAAI,CAAC,KAAK,CAAC,eAAe,CAAC,CAAC;YAC5B,IAAI,CAAC;gBACH,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;YAC1B,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACf,IAAI,CAAC,KAAK,CAAC,kCAAkC,KAAK,EAAE,CAAC,CAAC;gBACtD,MAAM,KAAK,CAAC;YACd,CAAC;YAED,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,EAAE,CAAC;QAC5B,CAAC;KAAA;IAED;;;;;;;;;OASG;IACG,OAAO;;YACX,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC;YAClB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;YACjB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;YACpB,MAAM,IAAI,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC;QAC1B,CAAC;KAAA;IAED;;;;;;;;;;;OAWG;IACH,OAAO;QACL,OAAO,IAAI,CAAC,OAAO,KAAK,IAAI,CAAC;IAC/B,CAAC;CACF;AApGD,wBAoGC"}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.BulkMessageDelete = void 0;
|
|
4
|
-
const event_1 = require("./event");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the event handler for bulk message deletions.
|
|
7
|
-
*
|
|
8
|
-
* @extends Event
|
|
9
|
-
*/
|
|
10
|
-
class BulkMessageDelete extends event_1.Event {
|
|
11
|
-
/**
|
|
12
|
-
* Handles the bulk message delete event.
|
|
13
|
-
*
|
|
14
|
-
* @param {{ ids: string[] }} data - The data for the event, containing the IDs of the deleted messages.
|
|
15
|
-
*/
|
|
16
|
-
handle(data) {
|
|
17
|
-
// TODO: Get cached messages
|
|
18
|
-
this.client.emit(event_1.Events.MESSAGE_DELETE_BULK, data.ids);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
exports.BulkMessageDelete = BulkMessageDelete;
|
|
22
|
-
//# sourceMappingURL=bulkMessageDelete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulkMessageDelete.js","sourceRoot":"","sources":["../../../src/client/events/bulkMessageDelete.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,aAAK;IAC1C;;;;OAIG;IACH,MAAM,CAAC,IAAuB;QAC5B,4BAA4B;QAC5B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,mBAAmB,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC;IACzD,CAAC;CACF;AAVD,8CAUC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ChannelCreate = void 0;
|
|
13
|
-
const event_1 = require("./event");
|
|
14
|
-
/**
|
|
15
|
-
* Represents the event handler for channel creation.
|
|
16
|
-
*
|
|
17
|
-
* @extends Event
|
|
18
|
-
*/
|
|
19
|
-
class ChannelCreate extends event_1.Event {
|
|
20
|
-
/**
|
|
21
|
-
* Handles the channel creation event.
|
|
22
|
-
*
|
|
23
|
-
* @param {API.Channel} data - The raw data for the created channel from the API.
|
|
24
|
-
* @returns {Promise<{ channel: unknown }>} A promise that resolves with the created channel.
|
|
25
|
-
*/
|
|
26
|
-
handle(data) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
var _a;
|
|
29
|
-
const channel = this.client.channels._add(data);
|
|
30
|
-
if (channel) {
|
|
31
|
-
if (channel.inServer()) {
|
|
32
|
-
const server = (_a = channel.server) !== null && _a !== void 0 ? _a : (yield this.client.servers.fetch(channel.serverId));
|
|
33
|
-
server.channels.cache.set(channel.id, channel);
|
|
34
|
-
}
|
|
35
|
-
this.client.emit(event_1.Events.CHANNEL_CREATE, channel);
|
|
36
|
-
}
|
|
37
|
-
return { channel };
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
}
|
|
41
|
-
exports.ChannelCreate = ChannelCreate;
|
|
42
|
-
//# sourceMappingURL=channelCreate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelCreate.js","sourceRoot":"","sources":["../../../src/client/events/channelCreate.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAA6C;AAE7C;;;;GAIG;AACH,MAAa,aAAc,SAAQ,aAAK;IACtC;;;;;OAKG;IACG,MAAM,CAAC,IAAiB;;;YAC5B,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YAEhD,IAAI,OAAO,EAAE,CAAC;gBACZ,IAAI,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;oBACvB,MAAM,MAAM,GACV,MAAA,OAAO,CAAC,MAAM,mCAAI,CAAC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC;oBACxE,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,EAAE,OAAO,CAAC,CAAC;gBACjD,CAAC;gBACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;YACnD,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,CAAC;QACrB,CAAC;KAAA;CACF;AArBD,sCAqBC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChannelDelete = void 0;
|
|
4
|
-
const event_1 = require("./event");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the event handler for channel deletion.
|
|
7
|
-
*
|
|
8
|
-
* @extends Event
|
|
9
|
-
*/
|
|
10
|
-
class ChannelDelete extends event_1.Event {
|
|
11
|
-
/**
|
|
12
|
-
* Handles the channel deletion event.
|
|
13
|
-
*
|
|
14
|
-
* @param {{ id: string }} data - The data for the event, containing the ID of the deleted channel.
|
|
15
|
-
* @returns {{ channel: unknown }} An object containing the deleted channel, or `undefined` if not found.
|
|
16
|
-
*/
|
|
17
|
-
handle(data) {
|
|
18
|
-
var _a;
|
|
19
|
-
const channel = this.client.channels.cache.get(data.id);
|
|
20
|
-
if (channel) {
|
|
21
|
-
if (channel.inServer()) {
|
|
22
|
-
(_a = channel.server) === null || _a === void 0 ? void 0 : _a.channels.cache.delete(channel.id);
|
|
23
|
-
}
|
|
24
|
-
this.client.emit(event_1.Events.CHANNEL_DELETE, channel);
|
|
25
|
-
}
|
|
26
|
-
return { channel };
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
exports.ChannelDelete = ChannelDelete;
|
|
30
|
-
//# sourceMappingURL=channelDelete.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelDelete.js","sourceRoot":"","sources":["../../../src/client/events/channelDelete.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC;;;;GAIG;AACH,MAAa,aAAc,SAAQ,aAAK;IACtC;;;;;OAKG;IACH,MAAM,CAAC,IAAoB;;QACzB,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAExD,IAAI,OAAO,EAAE,CAAC;YACZ,IAAI,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;gBACvB,MAAA,OAAO,CAAC,MAAM,0CAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;YACpD,CAAC;YACD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACnD,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,CAAC;IACrB,CAAC;CACF;AAnBD,sCAmBC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ChannelGroupJoin = void 0;
|
|
13
|
-
const event_1 = require("./event");
|
|
14
|
-
/**
|
|
15
|
-
* Represents the event handler for a user joining a group channel.
|
|
16
|
-
*
|
|
17
|
-
* @extends Event
|
|
18
|
-
*/
|
|
19
|
-
class ChannelGroupJoin extends event_1.Event {
|
|
20
|
-
/**
|
|
21
|
-
* Handles the group channel join event.
|
|
22
|
-
*
|
|
23
|
-
* @param {{ id: string; user: string }} data - The data for the event, containing the channel ID and user ID.
|
|
24
|
-
* @returns {Promise<{ channel: unknown; user: unknown }>} A promise that resolves with the updated channel and user.
|
|
25
|
-
*/
|
|
26
|
-
handle(data) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const channel = this.client.channels.cache.get(data.id);
|
|
29
|
-
const user = yield this.client.users.fetch(data.user, { force: false });
|
|
30
|
-
if (channel === null || channel === void 0 ? void 0 : channel.isGroup()) {
|
|
31
|
-
channel.users.set(user.id, user);
|
|
32
|
-
this.client.emit(event_1.Events.GROUP_JOIN, channel, user);
|
|
33
|
-
}
|
|
34
|
-
return { channel, user };
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.ChannelGroupJoin = ChannelGroupJoin;
|
|
39
|
-
//# sourceMappingURL=channelGroupJoin.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelGroupJoin.js","sourceRoot":"","sources":["../../../src/client/events/channelGroupJoin.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAwC;AAExC;;;;GAIG;AACH,MAAa,gBAAiB,SAAQ,aAAK;IACzC;;;;;OAKG;IACG,MAAM,CAAC,IAAkC;;YAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAExE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAE,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,CAAC;gBACjC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,UAAU,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YACrD,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;KAAA;CACF;AAlBD,4CAkBC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.ChannelGroupLeave = void 0;
|
|
13
|
-
const event_1 = require("./event");
|
|
14
|
-
/**
|
|
15
|
-
* Represents the event handler for a user leaving a group channel.
|
|
16
|
-
*
|
|
17
|
-
* @extends Event
|
|
18
|
-
*/
|
|
19
|
-
class ChannelGroupLeave extends event_1.Event {
|
|
20
|
-
/**
|
|
21
|
-
* Handles the group channel leave event.
|
|
22
|
-
*
|
|
23
|
-
* @param {{ id: string; user: string }} data - The data for the event, containing the channel ID and user ID.
|
|
24
|
-
* @returns {Promise<{ channel: unknown; user: unknown }>} A promise that resolves with the updated channel and user.
|
|
25
|
-
*/
|
|
26
|
-
handle(data) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
const channel = this.client.channels.cache.get(data.id);
|
|
29
|
-
const user = yield this.client.users.fetch(data.user, { force: false });
|
|
30
|
-
if (channel === null || channel === void 0 ? void 0 : channel.isGroup()) {
|
|
31
|
-
channel.users.delete(data.user);
|
|
32
|
-
this.client.emit(event_1.Events.GROUP_LEAVE, channel, user);
|
|
33
|
-
}
|
|
34
|
-
return { channel, user };
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
exports.ChannelGroupLeave = ChannelGroupLeave;
|
|
39
|
-
//# sourceMappingURL=channelGroupLeave.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelGroupLeave.js","sourceRoot":"","sources":["../../../src/client/events/channelGroupLeave.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,mCAAwC;AAExC;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,aAAK;IAC1C;;;;;OAKG;IACG,MAAM,CAAC,IAAkC;;YAC7C,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACxD,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;YAExE,IAAI,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,EAAE,EAAE,CAAC;gBACvB,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBAChC,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;YACtD,CAAC;YAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;QAC3B,CAAC;KAAA;CACF;AAlBD,8CAkBC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChannelStartTyping = void 0;
|
|
4
|
-
const event_1 = require("./event");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the event handler for when a user starts typing in a channel.
|
|
7
|
-
*
|
|
8
|
-
* @extends Event
|
|
9
|
-
*/
|
|
10
|
-
class ChannelStartTyping extends event_1.Event {
|
|
11
|
-
/**
|
|
12
|
-
* Handles the typing start event.
|
|
13
|
-
*
|
|
14
|
-
* @param {{ id: string; user: string }} data - The data for the event, containing the channel ID and user ID.
|
|
15
|
-
* @returns {{ channel: unknown; user: unknown }} An object containing the channel and user involved in the event.
|
|
16
|
-
*/
|
|
17
|
-
handle(data) {
|
|
18
|
-
const channel = this.client.channels.cache.get(data.id);
|
|
19
|
-
const user = this.client.users.cache.get(data.user);
|
|
20
|
-
if ((channel === null || channel === void 0 ? void 0 : channel.isText()) && user) {
|
|
21
|
-
this.client.emit(event_1.Events.TYPING_START, channel, user);
|
|
22
|
-
}
|
|
23
|
-
return { channel, user };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.ChannelStartTyping = ChannelStartTyping;
|
|
27
|
-
//# sourceMappingURL=channelStarttyping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelStarttyping.js","sourceRoot":"","sources":["../../../src/client/events/channelStarttyping.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC;;;;GAIG;AACH,MAAa,kBAAmB,SAAQ,aAAK;IAC3C;;;;;OAKG;IACH,MAAM,CAAC,IAAkC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,KAAI,IAAI,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACvD,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF;AAjBD,gDAiBC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChannelStopTyping = void 0;
|
|
4
|
-
const event_1 = require("./event");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the event handler for when a user stops typing in a channel.
|
|
7
|
-
*
|
|
8
|
-
* @extends Event
|
|
9
|
-
*/
|
|
10
|
-
class ChannelStopTyping extends event_1.Event {
|
|
11
|
-
/**
|
|
12
|
-
* Handles the typing stop event.
|
|
13
|
-
*
|
|
14
|
-
* @param {{ id: string; user: string }} data - The data for the event, containing the channel ID and user ID.
|
|
15
|
-
* @returns {{ channel: unknown; user: unknown }} An object containing the channel and user involved in the event.
|
|
16
|
-
*/
|
|
17
|
-
handle(data) {
|
|
18
|
-
const channel = this.client.channels.cache.get(data.id);
|
|
19
|
-
const user = this.client.users.cache.get(data.user);
|
|
20
|
-
if ((channel === null || channel === void 0 ? void 0 : channel.isText()) && user) {
|
|
21
|
-
this.client.emit(event_1.Events.TYPING_STOP, channel, user);
|
|
22
|
-
}
|
|
23
|
-
return { channel, user };
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
exports.ChannelStopTyping = ChannelStopTyping;
|
|
27
|
-
//# sourceMappingURL=channelStopTyping.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelStopTyping.js","sourceRoot":"","sources":["../../../src/client/events/channelStopTyping.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AAExC;;;;GAIG;AACH,MAAa,iBAAkB,SAAQ,aAAK;IAC1C;;;;;OAKG;IACH,MAAM,CAAC,IAAkC;QACvC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,MAAM,IAAI,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAEpD,IAAI,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,MAAM,EAAE,KAAI,IAAI,EAAE,CAAC;YAC9B,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,WAAW,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;QACtD,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC3B,CAAC;CACF;AAjBD,8CAiBC"}
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ChannelUpdate = void 0;
|
|
4
|
-
const event_1 = require("./event");
|
|
5
|
-
/**
|
|
6
|
-
* Represents the event handler for channel updates.
|
|
7
|
-
*
|
|
8
|
-
* @extends Event
|
|
9
|
-
*/
|
|
10
|
-
class ChannelUpdate extends event_1.Event {
|
|
11
|
-
/**
|
|
12
|
-
* Handles the channel update event.
|
|
13
|
-
*
|
|
14
|
-
* @param {{ id: string; data: API.Channel; clear: API.FieldsChannel }} data - The data for the event, containing the channel ID, updated data, and fields to clear.
|
|
15
|
-
* @returns {void}
|
|
16
|
-
*/
|
|
17
|
-
handle(data) {
|
|
18
|
-
const channel = this.client.channels.cache.get(data.id);
|
|
19
|
-
const oldChannel = channel === null || channel === void 0 ? void 0 : channel._update(data.data);
|
|
20
|
-
if (channel && oldChannel && !channel.equals(oldChannel)) {
|
|
21
|
-
this.client.emit(event_1.Events.CHANNEL_UPDATE, oldChannel, channel);
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
exports.ChannelUpdate = ChannelUpdate;
|
|
26
|
-
//# sourceMappingURL=channelUpdate.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"channelUpdate.js","sourceRoot":"","sources":["../../../src/client/events/channelUpdate.ts"],"names":[],"mappings":";;;AAAA,mCAA6C;AAE7C;;;;GAIG;AACH,MAAa,aAAc,SAAQ,aAAK;IACtC;;;;;OAKG;IACH,MAAM,CAAC,IAIN;QACC,MAAM,OAAO,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QACxD,MAAM,UAAU,GAAG,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAE/C,IAAI,OAAO,IAAI,UAAU,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,UAAU,CAAC,EAAE,CAAC;YACzD,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,cAAM,CAAC,cAAc,EAAE,UAAU,EAAE,OAAO,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;CACF;AAnBD,sCAmBC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Events = exports.Event = void 0;
|
|
4
|
-
/**
|
|
5
|
-
* Represents the base class for all event handlers.
|
|
6
|
-
* All event handlers must extend this class and implement the `handle` method.
|
|
7
|
-
*/
|
|
8
|
-
class Event {
|
|
9
|
-
/**
|
|
10
|
-
* Creates a new Event instance.
|
|
11
|
-
*
|
|
12
|
-
* @param {client} client - The client instance.
|
|
13
|
-
*/
|
|
14
|
-
constructor(client) {
|
|
15
|
-
this.client = client;
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
exports.Event = Event;
|
|
19
|
-
var constants_1 = require("../../utils/constants");
|
|
20
|
-
Object.defineProperty(exports, "Events", { enumerable: true, get: function () { return constants_1.Events; } });
|
|
21
|
-
//# sourceMappingURL=event.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"event.js","sourceRoot":"","sources":["../../../src/client/events/event.ts"],"names":[],"mappings":";;;AAEA;;;GAGG;AACH,MAAsB,KAAK;IACzB;;;;OAIG;IACH,YAA+B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;IAAG,CAAC;CAUlD;AAhBD,sBAgBC;AAED,mDAA+C;AAAtC,mGAAA,MAAM,OAAA"}
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
|
-
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
36
|
-
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
37
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
38
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
39
|
-
};
|
|
40
|
-
var _EventManager_events;
|
|
41
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
42
|
-
exports.EventManager = void 0;
|
|
43
|
-
const Events = __importStar(require("./index"));
|
|
44
|
-
/**
|
|
45
|
-
* Manages the registration and retrieval of events for the client.
|
|
46
|
-
*/
|
|
47
|
-
class EventManager {
|
|
48
|
-
/**
|
|
49
|
-
* Creates a new EventManager instance.
|
|
50
|
-
*
|
|
51
|
-
* @param {client} client - The client instance.
|
|
52
|
-
*/
|
|
53
|
-
constructor(client) {
|
|
54
|
-
this.client = client;
|
|
55
|
-
/** A map of registered events, keyed by their names. */
|
|
56
|
-
_EventManager_events.set(this, new Map());
|
|
57
|
-
for (const Event of Object.values(Events)) {
|
|
58
|
-
this.register(Event);
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
/**
|
|
62
|
-
* Registers an event with the manager.
|
|
63
|
-
*
|
|
64
|
-
* @param {new (client: client) => CustomEvent} Event - The event class to register.
|
|
65
|
-
*/
|
|
66
|
-
register(Event) {
|
|
67
|
-
__classPrivateFieldGet(this, _EventManager_events, "f").set(Event.name.replace(/Events$/, ""), new Event(this.client));
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* Retrieves a registered event by its name.
|
|
71
|
-
*
|
|
72
|
-
* @param {string} name - The name of the event to retrieve.
|
|
73
|
-
* @returns {CustomEvent | null} The event instance, or `null` if not found.
|
|
74
|
-
*/
|
|
75
|
-
get(name) {
|
|
76
|
-
var _a;
|
|
77
|
-
return (_a = __classPrivateFieldGet(this, _EventManager_events, "f").get(name)) !== null && _a !== void 0 ? _a : null;
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
exports.EventManager = EventManager;
|
|
81
|
-
_EventManager_events = new WeakMap();
|
|
82
|
-
//# sourceMappingURL=eventManager.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"eventManager.js","sourceRoot":"","sources":["../../../src/client/events/eventManager.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gDAAkC;AAIlC;;GAEG;AACH,MAAa,YAAY;IAIvB;;;;OAIG;IACH,YAA+B,MAAc;QAAd,WAAM,GAAN,MAAM,CAAQ;QAR7C,wDAAwD;QACxD,+BAAU,IAAI,GAAG,EAAuB,EAAC;QAQvC,KAAK,MAAM,KAAK,IAAI,MAAM,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;YAC1C,IAAI,CAAC,QAAQ,CAAC,KAA4C,CAAC,CAAC;QAC9D,CAAC;IACH,CAAC;IAED;;;;OAIG;IACH,QAAQ,CAAC,KAA0C;QACjD,uBAAA,IAAI,4BAAQ,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC;IAC9E,CAAC;IAED;;;;;OAKG;IACH,GAAG,CAAC,IAAY;;QACd,OAAO,MAAA,uBAAA,IAAI,4BAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,mCAAI,IAAI,CAAC;IACxC,CAAC;CACF;AAjCD,oCAiCC"}
|
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./bulkMessageDelete"), exports);
|
|
18
|
-
__exportStar(require("./channelCreate"), exports);
|
|
19
|
-
__exportStar(require("./channelDelete"), exports);
|
|
20
|
-
__exportStar(require("./channelGroupJoin"), exports);
|
|
21
|
-
__exportStar(require("./channelGroupLeave"), exports);
|
|
22
|
-
__exportStar(require("./channelStarttyping"), exports);
|
|
23
|
-
__exportStar(require("./channelStopTyping"), exports);
|
|
24
|
-
__exportStar(require("./channelUpdate"), exports);
|
|
25
|
-
__exportStar(require("./message"), exports);
|
|
26
|
-
__exportStar(require("./messageDelete"), exports);
|
|
27
|
-
__exportStar(require("./messageUpdate"), exports);
|
|
28
|
-
__exportStar(require("./serverCreate"), exports);
|
|
29
|
-
__exportStar(require("./serverDelete"), exports);
|
|
30
|
-
__exportStar(require("./serverMemberJoin"), exports);
|
|
31
|
-
__exportStar(require("./serverMemberLeave"), exports);
|
|
32
|
-
__exportStar(require("./serverMemberUpdate"), exports);
|
|
33
|
-
__exportStar(require("./serverRoleDelete"), exports);
|
|
34
|
-
__exportStar(require("./serverRoleUpdate"), exports);
|
|
35
|
-
__exportStar(require("./serverupdate"), exports);
|
|
36
|
-
__exportStar(require("./userUpdate"), exports);
|
|
37
|
-
__exportStar(require("./messageReact"), exports);
|
|
38
|
-
__exportStar(require("./messageUnreact"), exports);
|
|
39
|
-
//# sourceMappingURL=index.js.map
|