seyfert 2.1.1-dev-12247418720.0 → 2.1.1-dev-12261178806.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.
@@ -16,8 +16,8 @@ import { type GatewayDispatchPayload, GatewayIntentBits } from '../types';
16
16
  import { Messages } from './resources/messages';
17
17
  import { Overwrites } from './resources/overwrites';
18
18
  export { BaseResource } from './resources/default/base';
19
- export { GuildRelatedResource } from './resources/default/guild-related';
20
19
  export { GuildBasedResource } from './resources/default/guild-based';
20
+ export { GuildRelatedResource } from './resources/default/guild-related';
21
21
  export type InferAsyncCache = InternalOptions extends {
22
22
  asyncCache: infer P;
23
23
  } ? P : false;
@@ -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.Cache = exports.GuildBasedResource = exports.GuildRelatedResource = exports.BaseResource = void 0;
17
+ exports.Cache = exports.GuildRelatedResource = exports.GuildBasedResource = exports.BaseResource = void 0;
18
18
  const common_1 = require("../common");
19
19
  const guilds_1 = require("./resources/guilds");
20
20
  const users_1 = require("./resources/users");
@@ -32,10 +32,10 @@ const messages_1 = require("./resources/messages");
32
32
  const overwrites_1 = require("./resources/overwrites");
33
33
  var base_1 = require("./resources/default/base");
34
34
  Object.defineProperty(exports, "BaseResource", { enumerable: true, get: function () { return base_1.BaseResource; } });
35
- var guild_related_1 = require("./resources/default/guild-related");
36
- Object.defineProperty(exports, "GuildRelatedResource", { enumerable: true, get: function () { return guild_related_1.GuildRelatedResource; } });
37
35
  var guild_based_1 = require("./resources/default/guild-based");
38
36
  Object.defineProperty(exports, "GuildBasedResource", { enumerable: true, get: function () { return guild_based_1.GuildBasedResource; } });
37
+ var guild_related_1 = require("./resources/default/guild-related");
38
+ Object.defineProperty(exports, "GuildRelatedResource", { enumerable: true, get: function () { return guild_related_1.GuildRelatedResource; } });
39
39
  __exportStar(require("./adapters/index"), exports);
40
40
  class Cache {
41
41
  intents;
@@ -117,7 +117,7 @@ class Cache {
117
117
  return this.hasIntent('DirectMessages');
118
118
  }
119
119
  get hasBansIntent() {
120
- return this.hasIntent('GuildBans');
120
+ return this.hasIntent('GuildModeration');
121
121
  }
122
122
  async bulkGet(keys) {
123
123
  const allData = {};
@@ -37,14 +37,13 @@ export declare class BaseClient {
37
37
  soundboards: SoundboardShorter;
38
38
  debugger?: Logger;
39
39
  logger: Logger;
40
- langs?: LangsHandler | undefined;
41
- commands?: CommandHandler | undefined;
42
- components?: ComponentHandler | undefined;
40
+ langs: LangsHandler;
41
+ commands: CommandHandler;
42
+ components: ComponentHandler;
43
43
  handleCommand: HandleCommand;
44
44
  private _applicationId?;
45
45
  private _botId?;
46
46
  middlewares?: Record<string, MiddlewareContext>;
47
- protected static assertString(value: unknown, message?: string): asserts value is string;
48
47
  protected static getBotIdFromToken(token: string): string;
49
48
  options: BaseClientOptions;
50
49
  constructor(options?: BaseClientOptions);
@@ -45,11 +45,6 @@ class BaseClient {
45
45
  _applicationId;
46
46
  _botId;
47
47
  middlewares;
48
- static assertString(value, message) {
49
- if (!(typeof value === 'string' && value !== '')) {
50
- throw new Error(message ?? 'Value is not a string');
51
- }
52
- }
53
48
  static getBotIdFromToken(token) {
54
49
  return Buffer.from(token.split('.')[0], 'base64').toString('ascii');
55
50
  }
@@ -191,7 +186,7 @@ class BaseClient {
191
186
  await this.loadComponents(options.componentsDir);
192
187
  const { token: tokenRC, debug } = await this.getRC();
193
188
  const token = options.token ?? tokenRC;
194
- BaseClient.assertString(token, 'token is not a string');
189
+ (0, common_1.assertString)(token, 'token is not a string');
195
190
  if (this.rest.options.token === 'INVALID')
196
191
  this.rest.options.token = token;
197
192
  this.rest.debug = debug;
@@ -248,14 +243,16 @@ class BaseClient {
248
243
  return should;
249
244
  }
250
245
  syncCachePath(cachePath) {
251
- return node_fs_1.promises.writeFile(cachePath, JSON.stringify(this.commands.values.filter(cmd => !('ignore' in cmd) || cmd.ignore !== shared_1.IgnoreCommand.Slash).map(x => x.toJSON())));
246
+ return node_fs_1.promises.writeFile(cachePath, JSON.stringify(this.commands.values
247
+ .filter(cmd => !('ignore' in cmd) || cmd.ignore !== shared_1.IgnoreCommand.Slash)
248
+ .map(x => x.toJSON())));
252
249
  }
253
250
  async uploadCommands({ applicationId, cachePath } = {}) {
254
251
  applicationId ??= await this.getRC().then(x => x.applicationId ?? this.applicationId);
255
- BaseClient.assertString(applicationId, 'applicationId is not a string');
252
+ (0, common_1.assertString)(applicationId, 'applicationId is not a string');
256
253
  const commands = this.commands.values;
257
254
  const filter = (0, common_1.filterSplit)(commands, command => ('guildId' in command ? !command.guildId : true));
258
- if (this.commands?.entryPoint) {
255
+ if (this.commands.entryPoint) {
259
256
  filter.expect.push(this.commands.entryPoint);
260
257
  }
261
258
  if (!cachePath || (await this.shouldUploadCommands(cachePath)))
@@ -19,7 +19,7 @@ export declare class Client<Ready extends boolean = boolean> extends BaseClient
19
19
  memberUpdateHandler: MemberUpdateHandler;
20
20
  presenceUpdateHandler: PresenceUpdateHandler;
21
21
  collectors: Collectors;
22
- events?: EventHandler | undefined;
22
+ events: EventHandler;
23
23
  constructor(options?: ClientOptions);
24
24
  setServices({ gateway, ...rest }: ServicesOptions & {
25
25
  gateway?: ShardManager;
@@ -35,7 +35,7 @@ class Client extends base_1.BaseClient {
35
35
  }
36
36
  async loadEvents(dir) {
37
37
  dir ??= await this.getRC().then(x => ('events' in x.locations ? x.locations.events : undefined));
38
- if (dir && this.events) {
38
+ if (dir) {
39
39
  await this.events.load(dir);
40
40
  this.logger.info('EventHandler loaded');
41
41
  }
@@ -70,7 +70,7 @@ class Client extends base_1.BaseClient {
70
70
  const intents = options?.connection?.intents ?? intentsRC;
71
71
  this.cache.intents = intents;
72
72
  if (!this.gateway) {
73
- base_1.BaseClient.assertString(token, 'token is not a string');
73
+ (0, common_1.assertString)(token, 'token is not a string');
74
74
  this.gateway = new websocket_1.ShardManager({
75
75
  token,
76
76
  info: await this.proxy.gateway.bot.get(),
@@ -105,7 +105,7 @@ class Client extends base_1.BaseClient {
105
105
  }
106
106
  async onPacket(shardId, packet) {
107
107
  Promise.allSettled([
108
- this.events?.runEvent('RAW', this, packet, shardId, false),
108
+ this.events.runEvent('RAW', this, packet, shardId, false),
109
109
  this.collectors.run('RAW', packet, this),
110
110
  ]); //ignore promise
111
111
  switch (packet.t) {
@@ -114,7 +114,7 @@ class Client extends base_1.BaseClient {
114
114
  if (!this.memberUpdateHandler.check(packet.d)) {
115
115
  return;
116
116
  }
117
- await this.events?.execute(packet, this, shardId);
117
+ await this.events.execute(packet, this, shardId);
118
118
  }
119
119
  break;
120
120
  case 'PRESENCE_UPDATE':
@@ -122,7 +122,7 @@ class Client extends base_1.BaseClient {
122
122
  if (!this.presenceUpdateHandler.check(packet.d)) {
123
123
  return;
124
124
  }
125
- await this.events?.execute(packet, this, shardId);
125
+ await this.events.execute(packet, this, shardId);
126
126
  }
127
127
  break;
128
128
  case 'GUILD_DELETE':
@@ -132,13 +132,13 @@ class Client extends base_1.BaseClient {
132
132
  if (!this.__handleGuilds?.length && [...this.gateway.values()].every(shard => shard.data.session_id)) {
133
133
  delete this.__handleGuilds;
134
134
  await this.cache.onPacket(packet);
135
- return this.events?.runEvent('BOT_READY', this, this.me, -1);
135
+ return this.events.runEvent('BOT_READY', this, this.me, -1);
136
136
  }
137
137
  if (!this.__handleGuilds?.length)
138
138
  delete this.__handleGuilds;
139
139
  return this.cache.onPacket(packet);
140
140
  }
141
- await this.events?.execute(packet, this, shardId);
141
+ await this.events.execute(packet, this, shardId);
142
142
  break;
143
143
  }
144
144
  //rest of the events
@@ -146,13 +146,13 @@ class Client extends base_1.BaseClient {
146
146
  switch (packet.t) {
147
147
  case 'INTERACTION_CREATE':
148
148
  {
149
- await this.events?.execute(packet, this, shardId);
149
+ await this.events.execute(packet, this, shardId);
150
150
  await this.handleCommand.interaction(packet.d, shardId);
151
151
  }
152
152
  break;
153
153
  case 'MESSAGE_CREATE':
154
154
  {
155
- await this.events?.execute(packet, this, shardId);
155
+ await this.events.execute(packet, this, shardId);
156
156
  await this.handleCommand.message(packet.d, shardId);
157
157
  }
158
158
  break;
@@ -166,16 +166,16 @@ class Client extends base_1.BaseClient {
166
166
  this.me = transformers_1.Transformers.ClientUser(this, packet.d.user, packet.d.application);
167
167
  if (!this.__handleGuilds?.length) {
168
168
  if ([...this.gateway.values()].every(shard => shard.data.session_id)) {
169
- await this.events?.runEvent('BOT_READY', this, this.me, -1);
169
+ await this.events.runEvent('BOT_READY', this, this.me, -1);
170
170
  }
171
171
  delete this.__handleGuilds;
172
172
  }
173
173
  this.debugger?.debug(`#${shardId}[${packet.d.user.username}](${this.botId}) is online...`);
174
- await this.events?.execute(packet, this, shardId);
174
+ await this.events.execute(packet, this, shardId);
175
175
  break;
176
176
  }
177
177
  default:
178
- await this.events?.execute(packet, this, shardId);
178
+ await this.events.execute(packet, this, shardId);
179
179
  break;
180
180
  }
181
181
  break;
@@ -18,7 +18,7 @@ export declare class WorkerClient<Ready extends boolean = boolean> extends BaseC
18
18
  memberUpdateHandler: MemberUpdateHandler;
19
19
  presenceUpdateHandler: PresenceUpdateHandler;
20
20
  collectors: Collectors;
21
- events?: EventHandler | undefined;
21
+ events: EventHandler;
22
22
  me: When<Ready, ClientUserStructure>;
23
23
  promises: Map<string, {
24
24
  resolve: (value: any) => void;
@@ -119,7 +119,7 @@ class WorkerClient extends base_1.BaseClient {
119
119
  }
120
120
  async loadEvents(dir) {
121
121
  dir ??= await this.getRC().then(x => ('events' in x.locations ? x.locations.events : undefined));
122
- if (dir && this.events) {
122
+ if (dir) {
123
123
  await this.events.load(dir);
124
124
  this.logger.info('EventHandler loaded');
125
125
  }
@@ -281,7 +281,7 @@ class WorkerClient extends base_1.BaseClient {
281
281
  }
282
282
  break;
283
283
  case 'BOT_READY':
284
- await this.events?.runEvent('BOT_READY', this, this.me, -1);
284
+ await this.events.runEvent('BOT_READY', this, this.me, -1);
285
285
  break;
286
286
  case 'API_RESPONSE':
287
287
  {
@@ -440,7 +440,7 @@ class WorkerClient extends base_1.BaseClient {
440
440
  }
441
441
  async onPacket(packet, shardId) {
442
442
  Promise.allSettled([
443
- this.events?.runEvent('RAW', this, packet, shardId, false),
443
+ this.events.runEvent('RAW', this, packet, shardId, false),
444
444
  this.collectors.run('RAW', packet, this),
445
445
  ]); //ignore promise
446
446
  switch (packet.t) {
@@ -449,7 +449,7 @@ class WorkerClient extends base_1.BaseClient {
449
449
  if (!this.memberUpdateHandler.check(packet.d)) {
450
450
  return;
451
451
  }
452
- await this.events?.execute(packet, this, shardId);
452
+ await this.events.execute(packet, this, shardId);
453
453
  }
454
454
  break;
455
455
  case 'PRESENCE_UPDATE':
@@ -457,7 +457,7 @@ class WorkerClient extends base_1.BaseClient {
457
457
  if (!this.presenceUpdateHandler.check(packet.d)) {
458
458
  return;
459
459
  }
460
- await this.events?.execute(packet, this, shardId);
460
+ await this.events.execute(packet, this, shardId);
461
461
  }
462
462
  break;
463
463
  case 'GUILD_DELETE':
@@ -471,26 +471,26 @@ class WorkerClient extends base_1.BaseClient {
471
471
  type: 'WORKER_READY',
472
472
  workerId: this.workerId,
473
473
  });
474
- return this.events?.runEvent('WORKER_READY', this, this.me, -1);
474
+ return this.events.runEvent('WORKER_READY', this, this.me, -1);
475
475
  }
476
476
  if (!this.__handleGuilds?.length)
477
477
  delete this.__handleGuilds;
478
478
  return this.cache.onPacket(packet);
479
479
  }
480
- await this.events?.execute(packet, this, shardId);
480
+ await this.events.execute(packet, this, shardId);
481
481
  break;
482
482
  }
483
483
  default: {
484
484
  switch (packet.t) {
485
485
  case 'INTERACTION_CREATE':
486
486
  {
487
- await this.events?.execute(packet, this, shardId);
487
+ await this.events.execute(packet, this, shardId);
488
488
  await this.handleCommand.interaction(packet.d, shardId);
489
489
  }
490
490
  break;
491
491
  case 'MESSAGE_CREATE':
492
492
  {
493
- await this.events?.execute(packet, this, shardId);
493
+ await this.events.execute(packet, this, shardId);
494
494
  await this.handleCommand.message(packet.d, shardId);
495
495
  }
496
496
  break;
@@ -503,14 +503,14 @@ class WorkerClient extends base_1.BaseClient {
503
503
  this.botId = packet.d.user.id;
504
504
  this.applicationId = packet.d.application.id;
505
505
  this.me = transformers_1.Transformers.ClientUser(this, packet.d.user, packet.d.application);
506
- await this.events?.execute(packet, this, shardId);
506
+ await this.events.execute(packet, this, shardId);
507
507
  if (!this._ready && [...this.shards.values()].every(shard => shard.data.session_id)) {
508
508
  this._ready = true;
509
509
  this.postMessage({
510
510
  type: 'WORKER_SHARDS_CONNECTED',
511
511
  workerId: this.workerId,
512
512
  });
513
- await this.events?.runEvent('WORKER_SHARDS_CONNECTED', this, this.me, -1);
513
+ await this.events.runEvent('WORKER_SHARDS_CONNECTED', this, this.me, -1);
514
514
  }
515
515
  if (!this.__handleGuilds?.length) {
516
516
  if ([...this.shards.values()].every(shard => shard.data.session_id)) {
@@ -518,7 +518,7 @@ class WorkerClient extends base_1.BaseClient {
518
518
  type: 'WORKER_READY',
519
519
  workerId: this.workerId,
520
520
  });
521
- await this.events?.runEvent('WORKER_READY', this, this.me, -1);
521
+ await this.events.runEvent('WORKER_READY', this, this.me, -1);
522
522
  }
523
523
  delete this.__handleGuilds;
524
524
  }
@@ -526,7 +526,7 @@ class WorkerClient extends base_1.BaseClient {
526
526
  }
527
527
  break;
528
528
  default:
529
- await this.events?.execute(packet, this, shardId);
529
+ await this.events.execute(packet, this, shardId);
530
530
  break;
531
531
  }
532
532
  break;
@@ -32,7 +32,7 @@ class CommandContext extends basecontext_1.BaseContext {
32
32
  return this.client.proxy;
33
33
  }
34
34
  get t() {
35
- return this.client.t(this.interaction?.locale ?? this.client.langs?.defaultLang ?? 'en-US');
35
+ return this.client.t(this.interaction?.locale ?? this.client.langs.defaultLang ?? 'en-US');
36
36
  }
37
37
  get fullCommandName() {
38
38
  return this.resolver.fullCommandName;
@@ -24,7 +24,7 @@ export declare class EntryPointContext<M extends keyof RegisteredMiddlewares = n
24
24
  modal(body: ModalCreateBodyRequest): Promise<undefined>;
25
25
  deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, undefined>>;
26
26
  editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
27
- deleteResponse(): Promise<void | undefined>;
27
+ deleteResponse(): Promise<void>;
28
28
  editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, void>>;
29
29
  fetchResponse(): Promise<import("../..").WebhookMessage>;
30
30
  channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;
@@ -25,7 +25,7 @@ export declare class MenuCommandContext<T extends MessageCommandInteraction | Us
25
25
  modal(body: ModalCreateBodyRequest): Promise<undefined>;
26
26
  deferReply<WR extends boolean = false>(ephemeral?: boolean, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, undefined>>;
27
27
  editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
28
- deleteResponse(): Promise<void | undefined>;
28
+ deleteResponse(): Promise<void>;
29
29
  editOrReply<WR extends boolean = false>(body: InteractionCreateBodyRequest | InteractionMessageUpdateBodyRequest, withResponse?: WR): Promise<import("../../common").When<WR, import("../..").WebhookMessage, void>>;
30
30
  fetchResponse(): Promise<import("../..").WebhookMessage>;
31
31
  channel(mode?: 'rest' | 'flow'): Promise<AllChannels>;
@@ -148,14 +148,14 @@ class HandleCommand {
148
148
  const context = new components_1.ModalContext(this.client, interaction);
149
149
  const extended = this.client.options?.context?.(interaction) ?? {};
150
150
  Object.assign(context, extended);
151
- await this.client.components?.executeModal(context);
151
+ await this.client.components.executeModal(context);
152
152
  }
153
153
  async messageComponent(interaction) {
154
154
  //@ts-expect-error
155
155
  const context = new components_1.ComponentContext(this.client, interaction);
156
156
  const extended = this.client.options?.context?.(interaction) ?? {};
157
157
  Object.assign(context, extended);
158
- await this.client.components?.executeComponent(context);
158
+ await this.client.components.executeComponent(context);
159
159
  }
160
160
  async interaction(body, shardId, __reply) {
161
161
  this.client.debugger?.debug(`[${types_1.InteractionType[body.type] ?? body.type}] Interaction received.`);
@@ -185,7 +185,7 @@ class HandleCommand {
185
185
  break;
186
186
  }
187
187
  case types_1.ApplicationCommandType.PrimaryEntryPoint: {
188
- const command = this.client.commands?.entryPoint;
188
+ const command = this.client.commands.entryPoint;
189
189
  if (!command?.run)
190
190
  return;
191
191
  const interaction = structures_1.BaseInteraction.from(this.client, body, __reply);
@@ -214,7 +214,7 @@ class HandleCommand {
214
214
  case types_1.InteractionType.ModalSubmit:
215
215
  {
216
216
  const interaction = structures_1.BaseInteraction.from(this.client, body, __reply);
217
- if (this.client.components?.hasModal(interaction)) {
217
+ if (this.client.components.hasModal(interaction)) {
218
218
  await this.client.components.onModalSubmit(interaction);
219
219
  }
220
220
  else
@@ -224,7 +224,7 @@ class HandleCommand {
224
224
  case types_1.InteractionType.MessageComponent:
225
225
  {
226
226
  const interaction = structures_1.BaseInteraction.from(this.client, body, __reply);
227
- if (this.client.components?.hasComponent(body.message.id, interaction.customId)) {
227
+ if (this.client.components.hasComponent(body.message.id, interaction.customId)) {
228
228
  await this.client.components.onComponent(body.message.id, interaction);
229
229
  }
230
230
  else
@@ -120,3 +120,4 @@ export declare function hasProps<T extends Record<any, any>>(target: T, props: T
120
120
  export declare function hasIntent(intents: number, target: keyof typeof GatewayIntentBits | GatewayIntentBits): boolean;
121
121
  export declare function toArrayBuffer(buffer: Buffer): ArrayBuffer;
122
122
  export declare function toBuffer(arrayBuffer: ArrayBuffer): Buffer<ArrayBuffer>;
123
+ export declare function assertString(value: unknown, message?: string): asserts value is string;
@@ -21,6 +21,7 @@ exports.hasProps = hasProps;
21
21
  exports.hasIntent = hasIntent;
22
22
  exports.toArrayBuffer = toArrayBuffer;
23
23
  exports.toBuffer = toBuffer;
24
+ exports.assertString = assertString;
24
25
  const node_fs_1 = require("node:fs");
25
26
  const node_path_1 = require("node:path");
26
27
  const __1 = require("..");
@@ -385,3 +386,8 @@ function toBuffer(arrayBuffer) {
385
386
  }
386
387
  return buffer;
387
388
  }
389
+ function assertString(value, message) {
390
+ if (!(typeof value === 'string' && value !== '')) {
391
+ throw new Error(message ?? 'Value is not a string');
392
+ }
393
+ }
@@ -13,7 +13,7 @@ class BanShorter extends base_1.BaseShorter {
13
13
  async bulkCreate(guildId, body, reason) {
14
14
  const bans = await this.client.proxy.guilds(guildId)['bulk-bans'].post({ reason, body });
15
15
  for (const id of bans.banned_users)
16
- this.client.cache.members?.removeIfNI('GuildBans', id, guildId);
16
+ this.client.cache.members?.removeIfNI('GuildModeration', id, guildId);
17
17
  return bans;
18
18
  }
19
19
  /**
@@ -34,7 +34,7 @@ class BanShorter extends base_1.BaseShorter {
34
34
  */
35
35
  async create(guildId, memberId, body, reason) {
36
36
  await this.client.proxy.guilds(guildId).bans(memberId).put({ reason, body });
37
- await this.client.cache.members?.removeIfNI('GuildBans', memberId, guildId);
37
+ await this.client.cache.members?.removeIfNI('GuildModeration', memberId, guildId);
38
38
  }
39
39
  /**
40
40
  * Fetches a ban from the guild.
@@ -7,7 +7,7 @@ export declare class InteractionShorter extends BaseShorter {
7
7
  fetchOriginal(token: string): Promise<import("../..").WebhookMessage>;
8
8
  editMessage(token: string, messageId: string, body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
9
9
  editOriginal(token: string, body: InteractionMessageUpdateBodyRequest): Promise<import("../..").WebhookMessage>;
10
- deleteResponse(token: string, messageId: string): Promise<void | undefined>;
11
- deleteOriginal(token: string): Promise<void | undefined>;
10
+ deleteResponse(token: string, messageId: string): Promise<void>;
11
+ deleteOriginal(token: string): Promise<void>;
12
12
  followup(token: string, { files, ...body }: MessageWebhookCreateBodyRequest): Promise<import("../..").WebhookMessage>;
13
13
  }
@@ -48,7 +48,7 @@ class InteractionShorter extends base_1.BaseShorter {
48
48
  .webhooks(this.client.applicationId)(token)
49
49
  .messages(messageId)
50
50
  .delete()
51
- .then(() => this.client.components?.deleteValue(messageId, 'messageDelete'));
51
+ .then(() => this.client.components.deleteValue(messageId, 'messageDelete'));
52
52
  }
53
53
  deleteOriginal(token) {
54
54
  return this.deleteResponse(token, '@original');
@@ -61,7 +61,7 @@ class MemberShorter extends base_1.BaseShorter {
61
61
  */
62
62
  async ban(guildId, memberId, body, reason) {
63
63
  await this.client.proxy.guilds(guildId).bans(memberId).put({ reason, body });
64
- await this.client.cache.members?.removeIfNI('GuildBans', memberId, guildId);
64
+ await this.client.cache.members?.removeIfNI('GuildModeration', memberId, guildId);
65
65
  }
66
66
  /**
67
67
  * Kicks a member from the guild.
@@ -51,7 +51,7 @@ class MessageShorter extends base_1.BaseShorter {
51
51
  .delete({ reason })
52
52
  .then(async () => {
53
53
  await this.client.cache.messages?.removeIfNI('GuildMessages', messageId, channelId);
54
- this.client.components?.deleteValue(messageId, 'messageDelete');
54
+ this.client.components.deleteValue(messageId, 'messageDelete');
55
55
  });
56
56
  }
57
57
  fetch(messageId, channelId) {
@@ -70,7 +70,7 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
70
70
  * Deletes the response of the interaction.
71
71
  * @returns A promise that resolves when the response is deleted.
72
72
  */
73
- deleteResponse(): Promise<void | undefined>;
73
+ deleteResponse(): Promise<void>;
74
74
  modal(body: ModalCreateBodyRequest): Promise<undefined>;
75
75
  /**
76
76
  * Gets the channel of the interaction.
@@ -67,7 +67,7 @@ export declare class ModalContext<M extends keyof RegisteredMiddlewares = never>
67
67
  * Deletes the response of the interaction.
68
68
  * @returns A promise that resolves when the response is deleted.
69
69
  */
70
- deleteResponse(): Promise<void | undefined>;
70
+ deleteResponse(): Promise<void>;
71
71
  modal(body: ModalCreateBodyRequest): ReturnType<Interaction['modal']>;
72
72
  /**
73
73
  * Gets the channel of the interaction.
@@ -33,7 +33,7 @@ class ModalContext extends basecontext_1.BaseContext {
33
33
  * Gets the language object for the interaction's locale.
34
34
  */
35
35
  get t() {
36
- return this.client.t(this.interaction?.locale ?? this.client.langs?.defaultLang ?? 'en-US');
36
+ return this.client.t(this.interaction?.locale ?? this.client.langs.defaultLang ?? 'en-US');
37
37
  }
38
38
  /**
39
39
  * Writes a response to the interaction.
@@ -85,7 +85,7 @@ class EventHandler extends common_1.BaseHandler {
85
85
  switch (raw.t) {
86
86
  case 'MESSAGE_DELETE':
87
87
  {
88
- if (!client.components?.values.size)
88
+ if (!client.components.values.size)
89
89
  break;
90
90
  const value = client.components.values.get(raw.d.id);
91
91
  if (value) {
@@ -95,7 +95,7 @@ class EventHandler extends common_1.BaseHandler {
95
95
  break;
96
96
  case 'MESSAGE_DELETE_BULK':
97
97
  {
98
- if (!client.components?.values.size)
98
+ if (!client.components.values.size)
99
99
  break;
100
100
  for (const id of raw.d.ids) {
101
101
  const value = client.components.values.get(id);
@@ -107,7 +107,7 @@ class EventHandler extends common_1.BaseHandler {
107
107
  break;
108
108
  case 'GUILD_DELETE':
109
109
  {
110
- if (!client.components?.values.size)
110
+ if (!client.components.values.size)
111
111
  break;
112
112
  // ignore unavailable guilds?
113
113
  if (raw.d.unavailable)
@@ -120,7 +120,7 @@ class EventHandler extends common_1.BaseHandler {
120
120
  break;
121
121
  case 'CHANNEL_DELETE':
122
122
  {
123
- if (!client.components?.values.size)
123
+ if (!client.components.values.size)
124
124
  break;
125
125
  if (raw.d.type === types_1.ChannelType.DM || raw.d.type === types_1.ChannelType.GroupDM) {
126
126
  for (const value of client.components.values) {
@@ -147,7 +147,7 @@ class EventHandler extends common_1.BaseHandler {
147
147
  break;
148
148
  case 'THREAD_DELETE':
149
149
  {
150
- if (!client.components?.values.size)
150
+ if (!client.components.values.size)
151
151
  break;
152
152
  for (const value of client.components.values) {
153
153
  if (value[1].channelId === raw.d.id) {
@@ -76,8 +76,8 @@ export declare class Interaction<FromGuild extends boolean = boolean, Type exten
76
76
  editOrReply<FR extends boolean = false>(body: InteractionCreateBodyRequest, fetchReply?: FR): Promise<When<FR, WebhookMessageStructure, void>>;
77
77
  editMessage(messageId: string, body: InteractionMessageUpdateBodyRequest): Promise<import("./Message").WebhookMessage>;
78
78
  editResponse(body: InteractionMessageUpdateBodyRequest): Promise<import("./Message").WebhookMessage>;
79
- deleteResponse(): Promise<void | undefined>;
80
- deleteMessage(messageId: string): Promise<void | undefined>;
79
+ deleteResponse(): Promise<void>;
80
+ deleteMessage(messageId: string): Promise<void>;
81
81
  followup(body: MessageWebhookCreateBodyRequest): Promise<import("./Message").WebhookMessage>;
82
82
  }
83
83
  export declare class ApplicationCommandInteraction<FromGuild extends boolean = boolean, Type extends APIApplicationCommandInteraction = APIApplicationCommandInteraction> extends Interaction<FromGuild, Type> {
@@ -129,7 +129,7 @@ class BaseInteraction extends DiscordBase_1.DiscordBase {
129
129
  // @ts-expect-error
130
130
  if (body.data.__exec)
131
131
  this.client.components.modals.set(this.user.id, body.data.__exec);
132
- else if (this.client.components?.modals.has(this.user.id))
132
+ else if (this.client.components.modals.has(this.user.id))
133
133
  this.client.components.modals.delete(this.user.id);
134
134
  }
135
135
  return result;
@@ -262,10 +262,6 @@ export declare enum GatewayIntentBits {
262
262
  Guilds = 1,
263
263
  GuildMembers = 2,
264
264
  GuildModeration = 4,
265
- /**
266
- * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
267
- */
268
- GuildBans = 4,
269
265
  GuildExpressions = 8,
270
266
  GuildIntegrations = 16,
271
267
  GuildWebhooks = 32,
@@ -283,7 +279,9 @@ export declare enum GatewayIntentBits {
283
279
  AutoModerationConfiguration = 1048576,
284
280
  AutoModerationExecution = 2097152,
285
281
  GuildMessagePolls = 16777216,
286
- DirectMessagePolls = 33554432
282
+ DirectMessagePolls = 33554432,
283
+ NonPrivilaged = 53575421,
284
+ OnlyPrivilaged = 33026
287
285
  }
288
286
  /**
289
287
  * https://discord.com/developers/docs/topics/gateway-events#receive-events
@@ -246,10 +246,6 @@ var GatewayIntentBits;
246
246
  GatewayIntentBits[GatewayIntentBits["Guilds"] = 1] = "Guilds";
247
247
  GatewayIntentBits[GatewayIntentBits["GuildMembers"] = 2] = "GuildMembers";
248
248
  GatewayIntentBits[GatewayIntentBits["GuildModeration"] = 4] = "GuildModeration";
249
- /**
250
- * @deprecated This is the old name for {@apilink GatewayIntentBits#GuildModeration}
251
- */
252
- GatewayIntentBits[GatewayIntentBits["GuildBans"] = 4] = "GuildBans";
253
249
  GatewayIntentBits[GatewayIntentBits["GuildExpressions"] = 8] = "GuildExpressions";
254
250
  GatewayIntentBits[GatewayIntentBits["GuildIntegrations"] = 16] = "GuildIntegrations";
255
251
  GatewayIntentBits[GatewayIntentBits["GuildWebhooks"] = 32] = "GuildWebhooks";
@@ -268,6 +264,8 @@ var GatewayIntentBits;
268
264
  GatewayIntentBits[GatewayIntentBits["AutoModerationExecution"] = 2097152] = "AutoModerationExecution";
269
265
  GatewayIntentBits[GatewayIntentBits["GuildMessagePolls"] = 16777216] = "GuildMessagePolls";
270
266
  GatewayIntentBits[GatewayIntentBits["DirectMessagePolls"] = 33554432] = "DirectMessagePolls";
267
+ GatewayIntentBits[GatewayIntentBits["NonPrivilaged"] = 53575421] = "NonPrivilaged";
268
+ GatewayIntentBits[GatewayIntentBits["OnlyPrivilaged"] = 33026] = "OnlyPrivilaged";
271
269
  })(GatewayIntentBits || (exports.GatewayIntentBits = GatewayIntentBits = {}));
272
270
  /**
273
271
  * https://discord.com/developers/docs/topics/gateway-events#receive-events
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.1.1-dev-12247418720.0",
3
+ "version": "2.1.1-dev-12261178806.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",