cloudstorm 0.1.4 → 0.4.0

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.
@@ -0,0 +1,194 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ const events_1 = require("events");
6
+ const zlib_sync_1 = __importDefault(require("zlib-sync"));
7
+ let Erlpack;
8
+ try {
9
+ Erlpack = require("erlpack");
10
+ }
11
+ catch (e) {
12
+ Erlpack = null;
13
+ }
14
+ const Constants_1 = require("../Constants");
15
+ const ws_1 = __importDefault(require("ws"));
16
+ const RatelimitBucket_1 = __importDefault(require("./RatelimitBucket"));
17
+ /**
18
+ * Helper Class for simplifying the websocket connection to Discord.
19
+ */
20
+ class BetterWs extends events_1.EventEmitter {
21
+ /**
22
+ * Create a new BetterWs instance.
23
+ */
24
+ constructor(address, options = {}) {
25
+ super();
26
+ this.zlibInflate = null;
27
+ this.ws = new ws_1.default(address, options.socket);
28
+ this.bindWs(this.ws);
29
+ this.wsBucket = new RatelimitBucket_1.default(120, 60000);
30
+ this.presenceBucket = new RatelimitBucket_1.default(5, 20000);
31
+ if (options.compress) {
32
+ this.zlibInflate = new zlib_sync_1.default.Inflate({ chunkSize: 65535 });
33
+ this.compress = true;
34
+ }
35
+ else
36
+ this.compress = false;
37
+ this.options = options;
38
+ }
39
+ /**
40
+ * Get the raw websocket connection currently used.
41
+ */
42
+ get rawWs() {
43
+ return this.ws;
44
+ }
45
+ /**
46
+ * Add eventlisteners to a passed websocket connection.
47
+ * @param ws Websocket.
48
+ */
49
+ bindWs(ws) {
50
+ ws.on("message", (msg) => {
51
+ this.onMessage(msg);
52
+ });
53
+ ws.on("close", (code, reason) => this.onClose(code, reason.toString()));
54
+ ws.on("error", (err) => {
55
+ this.emit("error", err);
56
+ });
57
+ ws.on("open", () => this.onOpen());
58
+ }
59
+ /**
60
+ * Create a new websocket connection if the old one was closed/destroyed.
61
+ * @param address Address to connect to.
62
+ * @param options Options used by the websocket connection.
63
+ */
64
+ recreateWs(address, options = {}) {
65
+ this.ws.removeAllListeners();
66
+ if (options.compress) {
67
+ this.zlibInflate = new zlib_sync_1.default.Inflate({ chunkSize: 65535 });
68
+ this.compress = true;
69
+ }
70
+ else {
71
+ this.zlibInflate = null;
72
+ this.compress = false;
73
+ }
74
+ this.ws = new ws_1.default(address, options.socket);
75
+ this.options = options;
76
+ this.wsBucket.dropQueue();
77
+ this.presenceBucket.dropQueue();
78
+ this.wsBucket = new RatelimitBucket_1.default(120, 60000);
79
+ this.presenceBucket = new RatelimitBucket_1.default(5, 60000);
80
+ this.bindWs(this.ws);
81
+ }
82
+ /**
83
+ * Called upon opening of the websocket connection.
84
+ */
85
+ onOpen() {
86
+ this.emit("ws_open");
87
+ }
88
+ /**
89
+ * Called once a websocket message is received,
90
+ * uncompresses the message using zlib and parses it via Erlpack or JSON.parse.
91
+ * @param message Message received by websocket.
92
+ */
93
+ onMessage(message) {
94
+ let parsed;
95
+ try {
96
+ let msg;
97
+ if (this.compress && this.zlibInflate) {
98
+ const length = message.length;
99
+ const flush = length >= 4 &&
100
+ message[length - 4] === 0x00 &&
101
+ message[length - 3] === 0x00 &&
102
+ message[length - 2] === 0xFF &&
103
+ message[length - 1] === 0xFF;
104
+ this.zlibInflate.push(message, flush ? zlib_sync_1.default.Z_SYNC_FLUSH : false);
105
+ if (!flush)
106
+ return;
107
+ msg = this.zlibInflate.result;
108
+ }
109
+ else
110
+ msg = message;
111
+ if (Erlpack) {
112
+ parsed = Erlpack.unpack(msg);
113
+ }
114
+ else {
115
+ parsed = JSON.parse(String(msg));
116
+ }
117
+ }
118
+ catch (e) {
119
+ this.emit("error", `Message: ${message} was not parseable`);
120
+ return;
121
+ }
122
+ this.emit("ws_message", parsed);
123
+ }
124
+ /**
125
+ * Called when the websocket connection closes for some reason.
126
+ * @param code Websocket close code.
127
+ * @param reason Reason of the close if any.
128
+ */
129
+ onClose(code, reason) {
130
+ this.emit("ws_close", code, reason);
131
+ }
132
+ /**
133
+ * Send a message to the Discord gateway.
134
+ * @param data Data to send.
135
+ */
136
+ sendMessage(data) {
137
+ if (this.ws.readyState !== ws_1.default.OPEN)
138
+ return Promise.reject(new Error("WS is not open"));
139
+ this.emit("debug_send", data);
140
+ return new Promise((res, rej) => {
141
+ const presence = data.op === Constants_1.GATEWAY_OP_CODES.PRESENCE_UPDATE;
142
+ try {
143
+ if (Erlpack) {
144
+ data = Erlpack.pack(data);
145
+ }
146
+ else {
147
+ data = JSON.stringify(data);
148
+ }
149
+ }
150
+ catch (e) {
151
+ return rej(e);
152
+ }
153
+ const sendMsg = () => {
154
+ // The promise from wsBucket is ignored, since the method passed to it does not return a promise
155
+ this.wsBucket.queue(() => {
156
+ this.ws.send(data, {}, (e) => {
157
+ if (e) {
158
+ return rej(e);
159
+ }
160
+ res();
161
+ });
162
+ });
163
+ };
164
+ if (presence) {
165
+ // same here
166
+ this.presenceBucket.queue(sendMsg);
167
+ }
168
+ else {
169
+ sendMsg();
170
+ }
171
+ });
172
+ }
173
+ /**
174
+ * Close the current websocket connection.
175
+ * @param code Websocket close code to use.
176
+ * @param reason Reason of the disconnect.
177
+ */
178
+ close(code = 1000, reason = "Unknown") {
179
+ if (this.ws.readyState === ws_1.default.CLOSING || this.ws.readyState === ws_1.default.CLOSED)
180
+ return Promise.reject(new Error("WS is already closing or is closed"));
181
+ return new Promise((res, rej) => {
182
+ const timeout = setTimeout(() => {
183
+ return rej("Websocket not closed within 5 seconds");
184
+ }, 5 * 1000);
185
+ this.ws.once("close", () => {
186
+ clearTimeout(timeout);
187
+ return res();
188
+ });
189
+ this.ws.close(code, reason);
190
+ });
191
+ }
192
+ }
193
+ BetterWs.default = BetterWs;
194
+ module.exports = BetterWs;
@@ -0,0 +1,41 @@
1
+ /// <reference types="node" />
2
+ /**
3
+ * RatelimitBucket, used for ratelimiting the execution of functions.
4
+ */
5
+ declare class RatelimitBucket {
6
+ fnQueue: Array<{
7
+ fn: (...args: Array<any>) => any;
8
+ callback: () => any;
9
+ error: Error;
10
+ }>;
11
+ limit: number;
12
+ remaining: number;
13
+ limitReset: number;
14
+ resetTimeout: NodeJS.Timeout | null;
15
+ static readonly default: typeof RatelimitBucket;
16
+ /**
17
+ * Create a new Bucket.
18
+ * @param limit Number of functions that may be executed during the timeframe set in limitReset.
19
+ * @param limitReset Timeframe in milliseconds until the ratelimit resets.
20
+ */
21
+ constructor(limit?: number, limitReset?: number);
22
+ /**
23
+ * Queue a function to be executed.
24
+ * @param fn Function to be executed.
25
+ * @returns Result of the function if any.
26
+ */
27
+ queue(fn: (...args: Array<any>) => any): Promise<any>;
28
+ /**
29
+ * Check if there are any functions in the queue that haven't been executed yet.
30
+ */
31
+ private checkQueue;
32
+ /**
33
+ * Reset the remaining tokens to the base limit.
34
+ */
35
+ private resetRemaining;
36
+ /**
37
+ * Clear the current queue of events to be sent.
38
+ */
39
+ dropQueue(): void;
40
+ }
41
+ export = RatelimitBucket;
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ /**
3
+ * RatelimitBucket, used for ratelimiting the execution of functions.
4
+ */
5
+ class RatelimitBucket {
6
+ /**
7
+ * Create a new Bucket.
8
+ * @param limit Number of functions that may be executed during the timeframe set in limitReset.
9
+ * @param limitReset Timeframe in milliseconds until the ratelimit resets.
10
+ */
11
+ constructor(limit = 5, limitReset = 5000) {
12
+ this.fnQueue = [];
13
+ this.limit = limit;
14
+ this.remaining = limit;
15
+ this.limitReset = limitReset;
16
+ this.resetTimeout = null;
17
+ }
18
+ /**
19
+ * Queue a function to be executed.
20
+ * @param fn Function to be executed.
21
+ * @returns Result of the function if any.
22
+ */
23
+ queue(fn) {
24
+ // More debug-ability
25
+ const error = new Error("An Error occurred in the bucket queue");
26
+ return new Promise((res, rej) => {
27
+ const wrapFn = () => {
28
+ this.remaining--;
29
+ if (!this.resetTimeout) {
30
+ this.resetTimeout = setTimeout(() => {
31
+ try {
32
+ this.resetRemaining();
33
+ }
34
+ catch (e) {
35
+ rej(e);
36
+ }
37
+ }, this.limitReset);
38
+ }
39
+ if (this.remaining !== 0) {
40
+ this.checkQueue().catch(rej);
41
+ }
42
+ if (fn instanceof Promise) {
43
+ return fn.then(res).catch((e) => {
44
+ if (e) {
45
+ e.stack = error.stack;
46
+ return rej(e);
47
+ }
48
+ else
49
+ return rej(error);
50
+ });
51
+ }
52
+ return res(fn());
53
+ };
54
+ if (this.remaining === 0) {
55
+ this.fnQueue.push({
56
+ fn, callback: wrapFn, error
57
+ });
58
+ this.checkQueue().catch(rej);
59
+ }
60
+ else {
61
+ wrapFn();
62
+ }
63
+ });
64
+ }
65
+ /**
66
+ * Check if there are any functions in the queue that haven't been executed yet.
67
+ */
68
+ async checkQueue() {
69
+ if (this.fnQueue.length > 0 && this.remaining !== 0) {
70
+ const queuedFunc = this.fnQueue.splice(0, 1)[0];
71
+ try {
72
+ queuedFunc.callback();
73
+ }
74
+ catch (e) {
75
+ if (e) {
76
+ e.stack = queuedFunc.error.stack;
77
+ throw e;
78
+ }
79
+ else
80
+ throw queuedFunc.error;
81
+ }
82
+ }
83
+ }
84
+ /**
85
+ * Reset the remaining tokens to the base limit.
86
+ */
87
+ resetRemaining() {
88
+ this.remaining = this.limit;
89
+ if (this.resetTimeout) {
90
+ clearTimeout(this.resetTimeout);
91
+ this.resetTimeout = null;
92
+ }
93
+ this.checkQueue();
94
+ }
95
+ /**
96
+ * Clear the current queue of events to be sent.
97
+ */
98
+ dropQueue() {
99
+ this.fnQueue = [];
100
+ }
101
+ }
102
+ RatelimitBucket.default = RatelimitBucket;
103
+ module.exports = RatelimitBucket;
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es5.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2016.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.esnext.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.dom.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.core.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.object.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.array.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.object.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.promise.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.string.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.es2021.intl.d.ts","../../../../appdata/roaming/npm/node_modules/typescript/lib/lib.esnext.intl.d.ts","../src/constants.ts","../node_modules/snowtransfer/dist/constants.d.ts","../node_modules/snowtransfer/dist/endpoints.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/ts3.6/base.d.ts","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/base.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/snowtransfer/dist/ratelimitbuckets/localbucket.d.ts","../node_modules/snowtransfer/dist/ratelimiter.d.ts","../node_modules/snowtransfer/dist/requesthandler.d.ts","../node_modules/discord-typings/reference.d.ts","../node_modules/discord-typings/topics/permissions.d.ts","../node_modules/discord-typings/resources/emoji.d.ts","../node_modules/discord-typings/resources/voice.d.ts","../node_modules/discord-typings/topics/opcodesandstatuscodes.d.ts","../node_modules/discord-typings/topics/teams.d.ts","../node_modules/discord-typings/resources/application.d.ts","../node_modules/discord-typings/resources/sticker.d.ts","../node_modules/discord-typings/resources/guildscheduledevent.d.ts","../node_modules/discord-typings/resources/invite.d.ts","../node_modules/discord-typings/topics/gateway.d.ts","../node_modules/discord-typings/resources/stageinstance.d.ts","../node_modules/discord-typings/resources/guild.d.ts","../node_modules/discord-typings/resources/user.d.ts","../node_modules/discord-typings/interactions/messagecomponents.d.ts","../node_modules/discord-typings/interactions/receivingandresponding.d.ts","../node_modules/discord-typings/resources/channel.d.ts","../node_modules/discord-typings/interactions/applicationcommands.d.ts","../node_modules/discord-typings/resources/webhook.d.ts","../node_modules/discord-typings/resources/auditlog.d.ts","../node_modules/discord-typings/resources/guildtemplate.d.ts","../node_modules/discord-typings/topics/oauth2.d.ts","../node_modules/discord-typings/index.d.ts","../node_modules/snowtransfer/dist/methods/channels.d.ts","../node_modules/snowtransfer/dist/methods/users.d.ts","../node_modules/snowtransfer/dist/methods/guildassets.d.ts","../node_modules/snowtransfer/dist/methods/webhooks.d.ts","../node_modules/snowtransfer/dist/methods/guilds.d.ts","../node_modules/snowtransfer/dist/methods/guildscheduledevent.d.ts","../node_modules/snowtransfer/dist/methods/guildtemplate.d.ts","../node_modules/snowtransfer/dist/methods/interactions.d.ts","../node_modules/snowtransfer/dist/methods/invites.d.ts","../node_modules/snowtransfer/dist/methods/voices.d.ts","../node_modules/snowtransfer/dist/methods/bots.d.ts","../node_modules/snowtransfer/dist/methods/auditlog.d.ts","../node_modules/snowtransfer/dist/methods/stageinstance.d.ts","../node_modules/snowtransfer/dist/snowtransfer.d.ts","../node_modules/snowtransfer/dist/index.d.ts","../node_modules/zlib-sync/index.d.ts","../node_modules/@types/ws/index.d.ts","../src/structures/ratelimitbucket.ts","../src/types.d.ts","../node_modules/erlpack/js/index.d.ts","../src/structures/betterws.ts","../src/intents.ts","../src/connector/discordconnector.ts","../src/shard.ts","../src/shardmanager.ts","../src/client.ts","../src/index.ts"],"fileInfos":[{"version":"89f78430e422a0f06d13019d60d5a45b37ec2d28e67eb647f73b1b0d19a46b72","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","e21c071ca3e1b4a815d5f04a7475adcaeea5d64367e840dd0154096d705c3940","746d62152361558ea6d6115cf0da4dd10ede041d14882ede3568bce5dc4b4f1f","2cc028cd0bdb35b1b5eb723d84666a255933fffbea607f72cbd0c7c7b4bee144",{"version":"abba1071bfd89e55e88a054b0c851ea3e8a494c340d0f3fab19eb18f6afb0c9e","affectsGlobalScope":true},{"version":"d8996609230d17e90484a2dd58f22668f9a05a3bfe00bfb1d6271171e54a31fb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"4378fc8122ec9d1a685b01eb66c46f62aba6b239ca7228bb6483bcf8259ee493","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"62d80405c46c3f4c527ee657ae9d43fda65a0bf582292429aea1e69144a522a6","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"1b3fe904465430e030c93239a348f05e1be80640d91f2f004c3512c2c2c89f34","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"d071129cba6a5f2700be09c86c07ad2791ab67d4e5ed1eb301d6746c62745ea4","affectsGlobalScope":true},{"version":"6c55633c733c8378db65ac3da7a767c3cf2cf3057f0565a9124a16a3a2019e87","affectsGlobalScope":true},{"version":"fb4416144c1bf0323ccbc9afb0ab289c07312214e8820ad17d709498c865a3fe","affectsGlobalScope":true},{"version":"5b0ca94ec819d68d33da516306c15297acec88efeb0ae9e2b39f71dbd9685ef7","affectsGlobalScope":true},{"version":"e8c9f4e445a489991ca1a4232667de3ac36b07ba75ea335971fbeacf2d26fe67","affectsGlobalScope":true},{"version":"10bbdc1981b8d9310ee75bfac28ee0477bb2353e8529da8cff7cb26c409cb5e8","affectsGlobalScope":true},"9966ec0b03e7f0932a26e393e297e48dd31237cf514f1f973fd06e9d977b8f2c","241670ab33d6700a86b96dfd35c12d5ed2f2d109ffc5b6b0e124faec32ee00e7","762d474127360163db70f7dd29186037dca6049c15b993b0f84766a14bf93df8","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"34f1d0e1f63dd8c0bdc1fd15ec2b7216fd709953781c4d1b1213d88e2d94db9e","affectsGlobalScope":true},"4be51d991034b331db6a518e5a9607cb136b6d3ab2a691191a7d481354836a5f",{"version":"fa56e5f529c26a31207fecafbfd88136936868a4c17f8a347f0e8e6ea18309ad","affectsGlobalScope":true},"2f3a95a0e681afcde084379ed3b404ee09971425cf4600c3dd8b6f4adf058896","3fe5750809a130a0c9ee5dbca9e262913a10d1deda3ddb1280a77b099197e937",{"version":"d7e32c36d30042b47cd8620b197d3e3381954cf8baa413dc4273796e4cf718a1","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","41a3a8f7ba70f6e10fad838a363157217163bd897416480d0ed516b5d63e727e","53cf527b7d4a7ee1c16eeadff678d6df9f2a98cd5ece18f0f9211d8080204734","0038ccd1c90bc523ee4f7eeabc3f4082a48a5775415855e46f142447b9ad1114","aacb7a1f78d635e42d1112144c83508f340722e5293f7f14091581193618dca3","87c064559d14068edb2861fc7d48c1a8196a63523e00cc29aadd57c0eefb24a5","226afbe8d2d18dc02d1aebb449af0a11a278acb98b42c763aeec6d5a8e654441",{"version":"c3a43212afe9781a304d8f5dd3895fd38a143ac46fb64b4d343122e38c83a9ab","affectsGlobalScope":true},"ee738c1274439255c484262d0c6f90359c0209d42518d827b3f0167e44f633b2","01862fc59b8c037ea9fe03c6f3dc1ffc95bfc16fb37d58d6e7603706b9041d97","2163cfbd3438e495c08fb59b29740b1f96c7aec8ebb4faf9c9156f4fe94cb501","644a9cb29158878e67199d04c06699575d03812c90ea40c69d5a075fb8ec6b79","1f66294c9e9c24e84552cfaa70a27422811649de5a2efc69d3cf2ef38e833308","a82a261dac2131e55347889de6846a3e84741283d93d6525550ab3976be85cf6",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"1207275e727d14356922953c0597c77acad13e9812a0109a756c0c59ff0e87f3","dce04e108fbcbe674bceeea757269b7775a8a07693d6a58f55b36e649541675a","c90911387c5e9e024c309e63a14946a9bc3c71293e8f9d09eece16e11f167974","066f0de5d2acf0be06eb29a5ada8107f93891d7a983e6ba095260406650d742d",{"version":"6ae884f4861da8949f2c466b2d44fb087b2f1de82fe3449c3c52bd1d8cf998e6","affectsGlobalScope":true},"cbe717c2735bf2a6ceb29c2131232e74f4f95878072873dfb263566035024f99","5fd00b0ad7ef4e7eb69341da6ec17400922860afbdbc2cc46a37eba833d8a0bd","bc0c9dbd2b273d9466a31143a5f0118e8902232d906b3987d19d1bd67b96ee5d","757fec48e36f86c8b791b770c31f510d0e53817a95f61130df26df57cb382113","70d49d3e9f77b70197adabe6c06130c6ea5362316ea72feb142205c327f0aaa2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff","a279435e7813d1f061c0cab6ab77b1b9377e8d96851e5ed4a76a1ce6eb6e628f","28e6ac6505a2b6755ce0752cd4d2dbd880e0e4e9bbfeaa3c777821825db2711a",{"version":"8a4f510bad5e5f5312fd966d20675381a3467c0c8d1b528b7f8e5ebb732ba1c9","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","8ee0dfa79a0b3e43bd5c0554157051abd87ef47df49884eba3e6a10bba1ecdc1","dcbcf0056d7bcd4e716bd0cc9223913e58373095c4750250f525694d88f49962","715b8aedc97884235eac2346481e7f1cca0379f870a58a60d22f444f8b7c59a8","3dfbe800bece5d51c4a4abf726598bf4aa80b19ae4e8288ada7cf75efdc40930","2ac6c37c23dbb6a87d0657fbaa509bd077dd4ea066fecff1e94a01e19410d8c6","5d50d7b266824bd435c9696f71d64041db90667b6f95d5285adfa6946a73dde5","58250ab8b2768e6d713bb8271d4d1ed1029069bb94631764538a474fe1cb1eca","555122eabf41efe584457b407892ed4420c5dc5404004eafed8bc365459f1eef","56f3ed639ae070160aaa79a626e0f956374c7dcd2093216f48cc952981ea2e93",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"b9d6227d9cf5e2aac16c149377136b01e8692c0f82f185f6192c78285236e71d","359745bfbc578a51b1143fc7c49159f6068acf121017982519b88b04f27ea66a","31c268bcfbbb3a89dd4019ff8001069024921c2c0fb73bccc6f8e6f2da7bff09","35549c9daefc577a6d80bac1c1543b3588804fdda82cb1cf7b5293ca65b4dce4","84af13c14cff9bee64db4d363a52763dd9d3c79c019470e8773617edb67bf270","a6f8d474a7cf5d4ab22d761f14e5f6b85c0050728fdc69fd65d79980bc42e60f","6feef4cfd98b1ccdd6248a91008b5701a7a2fb0a61adbeb74ee7c8fac0f514da","8cff5283063cc4534f4c3b32dd339bf25920d53c7daaca2761317e2c2dea742f","dba1158a38c78ad31104b9cb36086133846b4c1b2b08d35f79868bdf2fc0ac8a","50d012d83e0e7eb222ca233269676b95f35116bcccd7bc1fb26c5b63a1a32527","a26ea102be21fbcae9d7eefe8e1deb6d5065af54a2470494fb55cf2b6c5f4793","ca6f8fe753ffd22a559a5838c4fe2a8a0c54ce9acd06464bbee549e6250a5814","08efe48606426eca55d9ff13f2849019d4689fa4cb2d27a9f0be4e543a7ce5e1","4cb4c93a284d529a689f96c49a162b654a86451543140e38e18d120342b59230","c960ef16f0024db825cd5395e275a556fdeedd6e6096fb8127de9a095310ea16","c9e75e2e8a8f78f713c243b95fa5ebf425eddf7a0f8ee4bf957d969ce522c055","2dc98f5ca38ced9fecc5fbd9c6547f2e1b91346848e385c3ed34d21ab5485b26","cf8b4dde972cfc12d371895e2c3336af610ac31c2a052c7d5171687f4d94640b","6f5f168bde77a5a553a0b2703aea33b25b8b6fd3657c32707fd7b135d37f7999","744338121e39ce5a4575436128483d851bec588019adb36e3550b8266fb7df06","f316ea316d6bb4bdee78b606ab7743fa41dd5fe6f9e20423b1cf2e12c145f778","b800c4657de5751c42a234152368abdc480201355c9ea2d79f1e2251f0a0923a","718f18909f7e3e7173e446ddcce0de5c2db20302196c242d6183e9db6dd86173","55fa5ab208fcc4e4a0b80ea7264eef7f33554943f4d375dba7f4a4457d82bc69","0ee2cf302a2bf95ec53eb932a779d9c8c8ca5d9ca9b437f2284062d175fccc5d","53c479afa9c0683507030f416648e6361723e607df5b8c56ecdf12ad14ead18a","cf8ef3555f09f8b71df47dc63dff5a869fb4afe4a1cb632dbec3dd625af725f3","cef33e4a401baf042a4eb8d98eeedd46740160a215d3c306c7b822deaf31be0a","e4ff2ec932357917fc93a319a654ca4a9e948392c8cb8e4a806e92d3add51047","e513fb76a4a263cd9385b0639d79d3e77dee2f918845ce5c1f4d63804b37f928","9f2c9e732e01e506055e2b6f336c24d8c1ea559c803e362dc0d4342b6e7902d1","1dec42ef5c7ff9fa01ac2c05ecb66d4b8b7d2b4b65ad7d7bdb01a3d727ee90d7","07d36410b1d0e2bfce13528fc8ecf1dbec31f6ec3986146410e1d6d6998fc148","4a5d2deb6c3edee59bc443c3bb0b2a1651e5101ee93aeb9261dcdedeed28b5af","b268af0197e558fdc32ca73bccd5dc25964093a15964da7a103c2450aaa47272","8a2556cb152a00bbbf2a5dadca1c6994f928258085c36aa24684c05b2f3e7274","4066f8d717c7c12da9bf8cba759a1d7449396d7f35b6eb4d4b4eec0d1647dda4","d948d6e7436ee4109e313b16269a1d2b5d14faf65d9437c976fb7ef4486b18f2","95e76615feb50312983f4ffd1f95051133a0f23f1af1a54a6ec0f22992c33504","7bd7d8f58f36696617c44d4ac8196284d9fad0036edc66ac5d1514c15fea2ee5","9a61a2e6282659624b125fd29aba2d2aadb3325e22ee8ea66123cbc658e1776f","c4b601ffd759466cacf25ffd585ac2fcf94fc0e8739ec179bea83e774872838a","d15f0313532fa6144d409cf896d9258750ce4f294cfe201642c7a02752a49f91","a2ba3ca93f1e681307c75f6ab8505ffad2a5557650f8435cb161b67a97880f4e","5a4048460b708d76d622a550df209789edb421c367e7ece5cd74c1eabc6d1813","7fed7ecc1c740cc737643da5966801ff99b4643b7ac8dbf44bbf84c0be5a6d7d","30581e5f1d7f73271ddc5338cf25f5076a4b8083818322d99b9a3f62e6e1b595","01a4041dcf47c62d6b9734756b49068144a94fca52f10417af4a96f4472770fb","2d752438075e0ac9ef83d8185fd6c0eea97db6760a47d2a64ee9b2a3bc563708","105372ed0c6cd92c3f2781d51cd785e3e7f9b833f6daeb79e713f97ea3e6adc0","9268041dca36b12662e17791e277a99b29f7697b79b0ef3b3a190c576c0b102d","411735b68f7101b462cb3db747bb133df0c5942b8537ec9bf587c5ec777b1927","323662d5d3f433fcb0461ae855995a7ba3a89e6ef12a8e3f97b8adafc921a185","c1ec7a6a7d903b28543578e34b50e06d7642e10bc8b50ad011c0e5ba7b72dc36","1a04faa86b4d13010a3cc6c07a8feb5288ae51a8eeeff3f8858d251cfae069e1","a684acfe5e1f2478e8c2c1a90a9187258e49202319d237c434a7f2643b177e22","531f0c6097ae16315b7f6705ea270abefd0f3f97b6853996f4f19d283bda6f35","5a013adbecf3026a50e5d4c91aa611de05d25f70f6731e1afa4a31c9e3796ef4"],"options":{"allowSyntheticDefaultImports":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"experimentalDecorators":true,"module":1,"noUnusedLocals":false,"outDir":"./","removeComments":false,"sourceMap":false,"strictNullChecks":true,"target":6},"fileIdsList":[[90],[90,98],[51,90],[90,97,98],[52,57,90],[53,63,64,71,80,89,90],[53,54,63,71,90],[55,90],[56,57,64,72,90],[57,80,86,90],[58,60,63,71,90],[59,90],[60,61,90],[62,63,90],[63,90],[63,64,65,80,89,90],[63,64,65,80,90],[66,71,80,89,90],[63,64,66,67,71,80,86,89,90],[66,68,80,86,89,90],[90,99],[63,69,90],[70,89,90],[60,63,71,80,90],[72,90],[73,90],[51,74,90],[75,88,90,93],[76,90],[77,90],[63,78,90],[78,79,90,92],[63,80,81,90],[80,81,90],[82,90],[83,90],[63,84,85,90],[84,85,90],[57,71,86,90],[87,90],[49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96],[71,88,90],[52,66,77,89,90],[57,90],[80,90,91],[90,92],[90,96],[52,57,63,65,74,80,89,90,92,93],[80,90,94],[63,66,68,80,86,89,90,94,100],[90,104,105,106,107,108,109,110,111,112,113,114,115,116,117,118,119,120,121,122,123,124,125],[90,104,120],[90,106],[90,104,105,116,117,118,120,121],[90,104,109,117],[90,104,112,116,117,120,122],[90,104,106,110,111,116,117,118,119],[90,104,117],[90,104,105,106,107,111,112,114,115,117,120],[90,104,116,117],[90,110,112,116,117,120],[90,104],[90,104,116],[90,104,116,117,120],[90,104,105,106,108,110,111,113,116,117,120],[47,48,90,140],[90,103,126],[90,100,103,126],[90,103,126,130],[90,102],[90,100,101],[63,90,100,102],[90,102,103,127,128,129,130,131,132,133,134,135,136,137,138,139],[46,63,90,126,141,145,146,151],[46,63,90,126,143,145,147,148,152],[46,90],[46,90,145,148,152,153],[90,145,148],[46,63,90,126,145,149,152],[90,126,150,152],[46,63,90,142,143,144,145,146],[90,126,141,143]],"referencedMap":[[10,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[40,1],[36,1],[37,1],[38,1],[39,1],[8,1],[44,1],[41,1],[42,1],[43,1],[1,1],[9,1],[45,1],[98,2],[49,2],[51,3],[99,4],[52,5],[53,6],[54,7],[55,8],[56,9],[57,10],[58,11],[59,12],[60,13],[61,13],[62,14],[63,15],[64,16],[65,17],[50,1],[95,1],[66,18],[67,19],[68,20],[100,21],[69,22],[70,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[81,34],[82,35],[83,36],[84,37],[85,38],[86,39],[87,40],[97,41],[88,42],[89,43],[90,44],[91,45],[92,46],[96,47],[93,48],[94,49],[143,50],[126,51],[121,52],[118,53],[119,54],[104,1],[110,55],[123,56],[120,57],[106,58],[116,59],[112,60],[124,60],[113,61],[115,62],[111,58],[117,63],[107,63],[122,64],[114,65],[125,1],[108,1],[105,62],[109,58],[146,1],[47,1],[48,1],[141,66],[138,67],[137,67],[127,68],[129,68],[131,67],[132,67],[133,67],[134,69],[135,67],[139,67],[128,67],[136,67],[130,68],[101,70],[102,71],[103,72],[140,73],[142,1],[152,74],[149,75],[46,76],[153,77],[148,78],[150,79],[151,80],[147,81],[144,1],[145,82]],"exportedModulesMap":[[10,1],[12,1],[11,1],[2,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[3,1],[4,1],[24,1],[21,1],[22,1],[23,1],[25,1],[26,1],[27,1],[5,1],[28,1],[29,1],[30,1],[31,1],[6,1],[32,1],[33,1],[34,1],[35,1],[7,1],[40,1],[36,1],[37,1],[38,1],[39,1],[8,1],[44,1],[41,1],[42,1],[43,1],[1,1],[9,1],[45,1],[98,2],[49,2],[51,3],[99,4],[52,5],[53,6],[54,7],[55,8],[56,9],[57,10],[58,11],[59,12],[60,13],[61,13],[62,14],[63,15],[64,16],[65,17],[50,1],[95,1],[66,18],[67,19],[68,20],[100,21],[69,22],[70,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[81,34],[82,35],[83,36],[84,37],[85,38],[86,39],[87,40],[97,41],[88,42],[89,43],[90,44],[91,45],[92,46],[96,47],[93,48],[94,49],[143,50],[126,51],[121,52],[118,53],[119,54],[104,1],[110,55],[123,56],[120,57],[106,58],[116,59],[112,60],[124,60],[113,61],[115,62],[111,58],[117,63],[107,63],[122,64],[114,65],[125,1],[108,1],[105,62],[109,58],[146,1],[47,1],[48,1],[141,66],[138,67],[137,67],[127,68],[129,68],[131,67],[132,67],[133,67],[134,69],[135,67],[139,67],[128,67],[136,67],[130,68],[101,70],[102,71],[103,72],[140,73],[142,1],[152,74],[149,75],[46,76],[153,77],[148,78],[150,79],[151,80],[147,81],[144,1],[145,82]],"semanticDiagnosticsPerFile":[10,12,11,2,13,14,15,16,17,18,19,20,3,4,24,21,22,23,25,26,27,5,28,29,30,31,6,32,33,34,35,7,40,36,37,38,39,8,44,41,42,43,1,9,45,98,49,51,99,52,53,54,55,56,57,58,59,60,61,62,63,64,65,50,95,66,67,68,100,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,97,88,89,90,91,92,96,93,94,143,126,121,118,119,104,110,123,120,106,116,112,124,113,115,111,117,107,122,114,125,108,105,109,146,47,48,141,138,137,127,129,131,132,133,134,135,139,128,136,130,101,102,103,140,142,152,149,46,153,148,150,151,147,144,145]},"version":"4.5.5"}
package/package.json CHANGED
@@ -1,30 +1,40 @@
1
- {
2
- "name": "cloudstorm",
3
- "version": "0.1.4",
4
- "description": "Minimalistic Discord Gateway library",
5
- "main": "index.js",
6
- "engines": {
7
- "node": ">=8.0.0"
8
- },
9
- "scripts": {
10
- "build:docs": "node_modules/.bin/docma -c docma.config.json"
11
- },
12
- "author": "wolke <wolke@weeb.sh>",
13
- "license": "MIT",
14
- "dependencies": {
15
- "snowtransfer": "^0.2.1",
16
- "ws": "^3.1.0",
17
- "zlib-sync": "^0.1.3"
18
- },
19
- "devDependencies": {
20
- "docma": "^1.5.1",
21
- "eslint": "^4.4.1"
22
- },
23
- "optionalDependencies": {
24
- "@types/node": "8.0.31",
25
- "@types/ws": "~3.0.2",
26
- "amqp": "0.2.6",
27
- "erlpack": "github:discordapp/erlpack",
28
- "eventemitter3": "~2.0.3"
29
- }
30
- }
1
+ {
2
+ "name": "cloudstorm",
3
+ "version": "0.4.0",
4
+ "description": "Minimalistic Discord Gateway library",
5
+ "main": "./dist/index.js",
6
+ "engines": {
7
+ "node": ">=12.0.0"
8
+ },
9
+ "types": "./dist/index.d.ts",
10
+ "scripts": {
11
+ "build:src": "tsc -p .",
12
+ "build:docs": "typedoc --name CloudStorm --excludeExternals --sort static-first --sort alphabetical"
13
+ },
14
+ "author": "wolke <wolke@weeb.sh>",
15
+ "license": "MIT",
16
+ "dependencies": {
17
+ "snowtransfer": "^0.4.x",
18
+ "ws": "^8.5.0",
19
+ "zlib-sync": "^0.1.7"
20
+ },
21
+ "devDependencies": {
22
+ "@types/node": "16.7.1",
23
+ "@types/ws": "^8.2.3",
24
+ "@typescript-eslint/eslint-plugin": "^5.12.0",
25
+ "@typescript-eslint/parser": "^5.12.0",
26
+ "eslint": "^8.9.0",
27
+ "typedoc": "^0.22.12",
28
+ "typedoc-plugin-mdn-links": "^1.0.5",
29
+ "typedoc-plugin-missing-exports": "^0.22.6",
30
+ "typescript": "^4.5.5"
31
+ },
32
+ "optionalDependencies": {
33
+ "erlpack": "github:discordapp/erlpack"
34
+ },
35
+ "files": [
36
+ "dist",
37
+ "README.md",
38
+ "LICENSE.md"
39
+ ]
40
+ }
package/.eslintrc.json DELETED
@@ -1,28 +0,0 @@
1
- {
2
- "env": {
3
- "es6": true,
4
- "node": true
5
- },
6
- "extends": "eslint:recommended",
7
- "parserOptions": {
8
- "sourceType": "module",
9
- "ecmaVersion": 2017
10
- },
11
- "rules": {
12
- "indent": [
13
- "error",
14
- 4,
15
- {
16
- "SwitchCase": 1
17
- }
18
- ],
19
- "quotes": [
20
- "error",
21
- "single"
22
- ],
23
- "semi": [
24
- "error",
25
- "always"
26
- ]
27
- }
28
- }
package/.jsdoc.json DELETED
@@ -1,18 +0,0 @@
1
- {
2
- "source": {
3
- "include": [
4
- "src",
5
- "package.json",
6
- "README.md"
7
- ],
8
- "includePattern": ".js$",
9
- "excludePattern": "(node_modules/|docs)"
10
- },
11
- "plugins": [
12
- "plugins/markdown"
13
- ],
14
- "opts": {
15
- "template": "./node_modules/minami",
16
- "destination": "./docs/"
17
- }
18
- }
package/.travis.yml DELETED
@@ -1,17 +0,0 @@
1
- language: node_js
2
- node_js:
3
- - '8'
4
- install:
5
- - npm install
6
- script:
7
- - npm run build:docs
8
- deploy:
9
- - provider: pages
10
- skip_cleanup: true
11
- github_token: $github_token
12
- local_dir: CloudStorm
13
- on:
14
- branch: dev
15
- env:
16
- global:
17
- secure: jaKLbvVGQiudHDsRxKZW9GH8Z0HL0oHQaQNA4rWOsgR1lVucJ/iMCNwStG0guFWdHlJFzVnVNtkNYRfKOfrzirVlOx/WDo3Ulwo9fyAC+k2yDIAqOJex6s5dtMRtr75cVYa6xUNyPE+ndJVY5wgc0Ocmt00gbE6LfAGzxlGDFq3yhueqibxUqAdYUPaJx8ckMMY8BbjFVwq9fnsyWH8x5iRDJTUtefYWcgHGfB4AuaYkyYnfjhEird6StSkmf/uaDEj9qJ8dtjxcCnsD3xTtD1d7MSvgXszPhZ/9El9e6Xky2+BWV6VJ8zCcFawXbkMK9qkMb5RI+ckfwqipqg3vyiUTa1ZG4NPNS6IK5uyvSGkjgAJksEfoTaxfm3H9oirqK97pYzxZDCUig4jKDtC32OqW6F4Tsijvsw4UQRh3EwlkObB7PWUPyEyoPawX847+9CpfOt59chJuN5UyqZepvK44L9lOMgWL/ohu4RjyFYHgfjShh2skeHPYD5SPhygXJrY4RjnvOhFsXRB9fSJCRTvcHofBR3p51orwxwvK15Q2vGOgMa7nsMiwF2xhXC0F0ulqZSpIPXEz/0nACm3b00XgJ4xfwFlqbDX3S0ERvTj9p3wwOQz77nZf1rnMe3QZIKWWYKwZLXxHcbB43j/E/M25z0mKZzJ3xNBukB2sX7c=
package/docma.config.json DELETED
@@ -1,51 +0,0 @@
1
- {
2
- "src": [
3
- {
4
- "CloudStorm": [
5
- "./src/**/*.js"
6
- ]
7
- },
8
- {
9
- "index": "./README.md"
10
- }
11
- ],
12
- "dest": "./CloudStorm",
13
- "app": {
14
- "title": "CloudStorm",
15
- "base": "/CloudStorm",
16
- "entrance": "content:index",
17
- "routing": "query",
18
- "server": "github"
19
- },
20
- "jsdoc": {
21
- "access": "public",
22
- "plugins": [
23
- "plugins/markdown"
24
- ]
25
- },
26
- "markdown": {
27
- "gfm": true,
28
- "tables": true,
29
- "breaks": false,
30
- "pedantic": false,
31
- "sanitize": false,
32
- "smartLists": false,
33
- "smartypants": false,
34
- "tasks": false,
35
- "emoji": true
36
- },
37
- "template": {
38
- "options": {
39
- "navItems": [
40
- {
41
- "label": "Home",
42
- "href": "?content=index"
43
- },
44
- {
45
- "label": "Documentation",
46
- "href": "?api=CloudStorm#Client"
47
- }
48
- ]
49
- }
50
- }
51
- }
@@ -1,31 +0,0 @@
1
- 'use strict';
2
- let CloudStorm = require('../../index').Client;
3
- let token = require('../config.json').token;
4
- let bot = new CloudStorm(token, {
5
- initialPresence: {status: 'online', game: {name: 'Wolking on Sunshine'}},
6
- firstShardId: 0,
7
- lastShardId: 0,
8
- shardAmount: 1
9
- });
10
- let amqp = require('amqp');
11
- let startup = async () => {
12
- let connection = amqp.createConnection({host: 'localhost'});
13
- connection.on('error', (e) => {
14
- console.error(e);
15
- });
16
- connection.on('ready', async () => {
17
- await bot.connect();
18
- bot.on('event', (event) => {
19
- connection.publish('test-pre-cache', event);
20
- // Event was sent to amqp queue, now you can use it somewhere else
21
- });
22
- });
23
- bot.on('ready', () => {
24
- console.log('Bot is ready');
25
- });
26
- };
27
- startup().catch(e => {
28
- console.error('Error on startup!');
29
- console.error(e);
30
- });
31
-
@@ -1,18 +0,0 @@
1
- 'use strict';
2
- let CloudStorm = require('../../index').Client;
3
- let token = require('../config.json').token;
4
- let bot = new CloudStorm(token);
5
- let startup = async () => {
6
- await bot.connect();
7
- bot.on('event', (event) => {
8
- // Do stuff with the received event ¯\_(ツ)_/¯
9
- });
10
- bot.on('ready', () => {
11
- console.log('Bot received ready event');
12
- });
13
- };
14
- startup().catch(e => {
15
- console.error('Error on startup!');
16
- console.error(e);
17
- });
18
-