seyfert 4.4.1 → 4.5.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.
- package/README.md +7 -1
- package/lib/api/utils/constants.d.ts +1 -1
- package/lib/api/utils/constants.js +1 -1
- package/lib/client/client.d.ts +1 -1
- package/lib/client/client.js +5 -4
- package/lib/client/workerclient.d.ts +1 -1
- package/lib/client/workerclient.js +6 -5
- package/lib/index.d.ts +1 -1
- package/lib/index.js +2 -1
- package/lib/websocket/constants/index.js +1 -1
- package/lib/websocket/discord/shard.js +1 -1
- package/lib/websocket/discord/sharder.js +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -71,4 +71,10 @@ For validation errors, metadata follows this convention:
|
|
|
71
71
|
- [Website](https://seyfert.dev)
|
|
72
72
|
- [Documentation](https://seyfert.dev/guide)
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
<a href="https://www.star-history.com/?repos=tiramisulabs%2Fseyfert&type=date&legend=top-left">
|
|
75
|
+
<picture>
|
|
76
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://api.star-history.com/chart?repos=tiramisulabs/seyfert&type=date&theme=dark&legend=top-left&sealed_token=UNrJ9iHEmmnlVRygDYxO2q0eWbqNUrt2kUF-SYwj3laAXxzq7eXDFXQzWAZc8uovRAdLFcDUjWqz7gpb1Nf8J0I9JzVfcsnjT4rBcMPO46-6t4msr0kZwwxDgbhwcK07h4U_-i1Q80fEaA-V9gc27ZHUf646ucLdm8QeOT0AIshgiALFD7C5HUjY1do7" />
|
|
77
|
+
<source media="(prefers-color-scheme: light)" srcset="https://api.star-history.com/chart?repos=tiramisulabs/seyfert&type=date&legend=top-left&sealed_token=UNrJ9iHEmmnlVRygDYxO2q0eWbqNUrt2kUF-SYwj3laAXxzq7eXDFXQzWAZc8uovRAdLFcDUjWqz7gpb1Nf8J0I9JzVfcsnjT4rBcMPO46-6t4msr0kZwwxDgbhwcK07h4U_-i1Q80fEaA-V9gc27ZHUf646ucLdm8QeOT0AIshgiALFD7C5HUjY1do7" />
|
|
78
|
+
<img alt="Star History Chart" src="https://api.star-history.com/chart?repos=tiramisulabs/seyfert&type=date&legend=top-left&sealed_token=UNrJ9iHEmmnlVRygDYxO2q0eWbqNUrt2kUF-SYwj3laAXxzq7eXDFXQzWAZc8uovRAdLFcDUjWqz7gpb1Nf8J0I9JzVfcsnjT4rBcMPO46-6t4msr0kZwwxDgbhwcK07h4U_-i1Q80fEaA-V9gc27ZHUf646ucLdm8QeOT0AIshgiALFD7C5HUjY1do7" />
|
|
79
|
+
</picture>
|
|
80
|
+
</a>
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const DefaultUserAgent: "DiscordBot (https://seyfert.dev, v4.
|
|
1
|
+
export declare const DefaultUserAgent: "DiscordBot (https://seyfert.dev, v4.5.0)";
|
|
2
2
|
export declare const ALLOWED_EXTENSIONS: readonly ["webp", "png", "jpg", "jpeg", "gif"];
|
|
3
3
|
export declare const ALLOWED_STICKER_EXTENSIONS: readonly ["png", "json", "gif"];
|
|
4
4
|
export declare const ALLOWED_SIZES: readonly [16, 32, 64, 100, 128, 256, 512, 1024, 2048, 4096];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ALLOWED_TAG_BADGE_EXTENSIONS = exports.ALLOWED_SOUNDS_EXTENSIONS = exports.ALLOWED_SIZES = exports.ALLOWED_STICKER_EXTENSIONS = exports.ALLOWED_EXTENSIONS = exports.DefaultUserAgent = void 0;
|
|
4
|
-
exports.DefaultUserAgent = 'DiscordBot (https://seyfert.dev, v4.
|
|
4
|
+
exports.DefaultUserAgent = 'DiscordBot (https://seyfert.dev, v4.5.0)';
|
|
5
5
|
exports.ALLOWED_EXTENSIONS = ['webp', 'png', 'jpg', 'jpeg', 'gif'];
|
|
6
6
|
exports.ALLOWED_STICKER_EXTENSIONS = ['png', 'json', 'gif'];
|
|
7
7
|
exports.ALLOWED_SIZES = [16, 32, 64, 100, 128, 256, 512, 1_024, 2_048, 4_096];
|
package/lib/client/client.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { CommandContext, Message } from '..';
|
|
2
2
|
import { type Awaitable, type DeepPartial, type PickPartial, type When } from '../common';
|
|
3
3
|
import { EventHandler } from '../events';
|
|
4
|
-
import type
|
|
4
|
+
import { type GatewayDispatchPayload, type GatewayPresenceUpdateData } from '../types';
|
|
5
5
|
import { ShardManager, type ShardManagerOptions } from '../websocket';
|
|
6
6
|
import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate';
|
|
7
7
|
import { PresenceUpdateHandler } from '../websocket/discord/events/presenceUpdate';
|
package/lib/client/client.js
CHANGED
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.Client = void 0;
|
|
4
4
|
const common_1 = require("../common");
|
|
5
5
|
const events_1 = require("../events");
|
|
6
|
+
const types_1 = require("../types");
|
|
6
7
|
const websocket_1 = require("../websocket");
|
|
7
8
|
const memberUpdate_1 = require("../websocket/discord/events/memberUpdate");
|
|
8
9
|
const presenceUpdate_1 = require("../websocket/discord/events/presenceUpdate");
|
|
@@ -156,19 +157,19 @@ class Client extends base_1.BaseClient {
|
|
|
156
157
|
//rest of the events
|
|
157
158
|
default: {
|
|
158
159
|
switch (packet.t) {
|
|
159
|
-
case
|
|
160
|
+
case types_1.GatewayDispatchEvents.InteractionCreate:
|
|
160
161
|
{
|
|
161
162
|
await this.events.execute(packet, this, shardId);
|
|
162
163
|
await this.handleCommand.interaction(packet.d, shardId);
|
|
163
164
|
}
|
|
164
165
|
break;
|
|
165
|
-
case
|
|
166
|
+
case types_1.GatewayDispatchEvents.MessageCreate:
|
|
166
167
|
{
|
|
167
168
|
await this.events.execute(packet, this, shardId);
|
|
168
169
|
await this.handleCommand.message(packet.d, shardId);
|
|
169
170
|
}
|
|
170
171
|
break;
|
|
171
|
-
case
|
|
172
|
+
case types_1.GatewayDispatchEvents.Ready: {
|
|
172
173
|
this.botId = packet.d.user.id;
|
|
173
174
|
this.applicationId = packet.d.application.id;
|
|
174
175
|
this.me = transformers_1.Transformers.ClientUser(this, packet.d.user, packet.d.application);
|
|
@@ -176,7 +177,7 @@ class Client extends base_1.BaseClient {
|
|
|
176
177
|
await this.events.execute(packet, this, shardId);
|
|
177
178
|
break;
|
|
178
179
|
}
|
|
179
|
-
case
|
|
180
|
+
case types_1.GatewayDispatchEvents.GuildsReady:
|
|
180
181
|
{
|
|
181
182
|
await this.events.execute(packet, this, shardId);
|
|
182
183
|
if ([...this.gateway.values()].every(shard => shard.isReady)) {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type Awaitable, type DeepPartial, type MakeRequired, type When } from '../common';
|
|
2
2
|
import { EventHandler } from '../events';
|
|
3
|
-
import type
|
|
3
|
+
import { type GatewayDispatchPayload } from '../types';
|
|
4
4
|
import { Shard, type ShardManagerOptions, type WorkerData } from '../websocket';
|
|
5
5
|
import { MemberUpdateHandler } from '../websocket/discord/events/memberUpdate';
|
|
6
6
|
import { PresenceUpdateHandler } from '../websocket/discord/events/presenceUpdate';
|
|
@@ -7,6 +7,7 @@ const __1 = require("..");
|
|
|
7
7
|
const cache_1 = require("../cache");
|
|
8
8
|
const common_1 = require("../common");
|
|
9
9
|
const events_1 = require("../events");
|
|
10
|
+
const types_1 = require("../types");
|
|
10
11
|
const websocket_1 = require("../websocket");
|
|
11
12
|
const memberUpdate_1 = require("../websocket/discord/events/memberUpdate");
|
|
12
13
|
const presenceUpdate_1 = require("../websocket/discord/events/presenceUpdate");
|
|
@@ -215,7 +216,7 @@ class WorkerClient extends base_1.BaseClient {
|
|
|
215
216
|
...this.options.gateway?.properties,
|
|
216
217
|
},
|
|
217
218
|
handlePayload(_, payload) {
|
|
218
|
-
if (payload.t !==
|
|
219
|
+
if (payload.t !== types_1.GatewayDispatchEvents.GuildsReady)
|
|
219
220
|
return;
|
|
220
221
|
if (++shardsConnected === workerData.shards.length) {
|
|
221
222
|
self.postMessage({
|
|
@@ -470,19 +471,19 @@ class WorkerClient extends base_1.BaseClient {
|
|
|
470
471
|
break;
|
|
471
472
|
default: {
|
|
472
473
|
switch (packet.t) {
|
|
473
|
-
case
|
|
474
|
+
case types_1.GatewayDispatchEvents.InteractionCreate:
|
|
474
475
|
{
|
|
475
476
|
await this.events.execute(packet, this, shardId);
|
|
476
477
|
await this.handleCommand.interaction(packet.d, shardId);
|
|
477
478
|
}
|
|
478
479
|
break;
|
|
479
|
-
case
|
|
480
|
+
case types_1.GatewayDispatchEvents.MessageCreate:
|
|
480
481
|
{
|
|
481
482
|
await this.events.execute(packet, this, shardId);
|
|
482
483
|
await this.handleCommand.message(packet.d, shardId);
|
|
483
484
|
}
|
|
484
485
|
break;
|
|
485
|
-
case
|
|
486
|
+
case types_1.GatewayDispatchEvents.Ready: {
|
|
486
487
|
this.botId = packet.d.user.id;
|
|
487
488
|
this.applicationId = packet.d.application.id;
|
|
488
489
|
this.me = transformers_1.Transformers.ClientUser(this, packet.d.user, packet.d.application);
|
|
@@ -497,7 +498,7 @@ class WorkerClient extends base_1.BaseClient {
|
|
|
497
498
|
this.debugger?.debug(`#${shardId}[${packet.d.user.username}](${this.botId}) is online...`);
|
|
498
499
|
break;
|
|
499
500
|
}
|
|
500
|
-
case
|
|
501
|
+
case types_1.GatewayDispatchEvents.GuildsReady:
|
|
501
502
|
{
|
|
502
503
|
if ([...this.shards.values()].every(shard => shard.isReady)) {
|
|
503
504
|
this.postMessage({
|
package/lib/index.d.ts
CHANGED
|
@@ -6,7 +6,7 @@ export * from './builders';
|
|
|
6
6
|
export * from './cache';
|
|
7
7
|
export { Collection, LimitedCollection } from './collection';
|
|
8
8
|
export * from './commands';
|
|
9
|
-
export { Formatter, Logger, PermissionStrings } from './common';
|
|
9
|
+
export { type AssignFilenameCallback, type CustomizeLoggerCallback, Formatter, Logger, type LoggerOptions, LogLevels, PermissionStrings, } from './common';
|
|
10
10
|
export * from './components';
|
|
11
11
|
export * from './events';
|
|
12
12
|
export * from './langs';
|
package/lib/index.js
CHANGED
|
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
exports.config = exports.WorkerManager = exports.ShardManager = exports.Logger = exports.Formatter = exports.LimitedCollection = exports.Collection = void 0;
|
|
17
|
+
exports.config = exports.WorkerManager = exports.ShardManager = exports.LogLevels = exports.Logger = exports.Formatter = exports.LimitedCollection = exports.Collection = void 0;
|
|
18
18
|
exports.createEvent = createEvent;
|
|
19
19
|
exports.extendContext = extendContext;
|
|
20
20
|
__exportStar(require("./client"), exports);
|
|
@@ -33,6 +33,7 @@ __exportStar(require("./commands"), exports);
|
|
|
33
33
|
var common_2 = require("./common");
|
|
34
34
|
Object.defineProperty(exports, "Formatter", { enumerable: true, get: function () { return common_2.Formatter; } });
|
|
35
35
|
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return common_2.Logger; } });
|
|
36
|
+
Object.defineProperty(exports, "LogLevels", { enumerable: true, get: function () { return common_2.LogLevels; } });
|
|
36
37
|
__exportStar(require("./components"), exports);
|
|
37
38
|
__exportStar(require("./events"), exports);
|
|
38
39
|
__exportStar(require("./langs"), exports);
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.properties = exports.WorkerManagerDefaults = exports.ShardManagerDefaults = exports.COMPRESS = void 0;
|
|
4
4
|
const COMPRESS = false;
|
|
5
5
|
exports.COMPRESS = COMPRESS;
|
|
6
|
-
const propertiesVersion = 'Seyfert v4.
|
|
6
|
+
const propertiesVersion = 'Seyfert v4.5.0 (https://seyfert.dev)';
|
|
7
7
|
const properties = {
|
|
8
8
|
os: process.platform,
|
|
9
9
|
browser: propertiesVersion,
|
|
@@ -250,7 +250,7 @@ class Shard {
|
|
|
250
250
|
this.data.session_id = packet.d.session_id;
|
|
251
251
|
this.flushOfflineSendQueue();
|
|
252
252
|
this.options.handlePayload(this.id, packet);
|
|
253
|
-
if (this.pendingGuilds?.size
|
|
253
|
+
if (!this.pendingGuilds?.size) {
|
|
254
254
|
this.isReady = true;
|
|
255
255
|
this.options.handlePayload(this.id, {
|
|
256
256
|
t: types_1.GatewayDispatchEvents.GuildsReady,
|
|
@@ -111,7 +111,7 @@ class ShardManager extends Map {
|
|
|
111
111
|
//waiting for all shards to connect
|
|
112
112
|
let shardsConnected = 0;
|
|
113
113
|
let handlePayload = (sharder, _, packet) => {
|
|
114
|
-
if (packet.t !==
|
|
114
|
+
if (packet.t !== types_1.GatewayDispatchEvents.GuildsReady)
|
|
115
115
|
return;
|
|
116
116
|
if (++shardsConnected !== info.shards)
|
|
117
117
|
return;
|
package/package.json
CHANGED