seyfert 2.1.1-dev-11420062278.0 → 2.1.1-dev-11464165753.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.
@@ -25,7 +25,7 @@ export declare class Embed {
25
25
  * @example
26
26
  * embed.setAuthor({ name: 'John Doe', iconURL: 'https://example.com/avatar.png' });
27
27
  */
28
- setAuthor(author: ObjectToLower<APIEmbedAuthor>): this;
28
+ setAuthor(author?: ObjectToLower<APIEmbedAuthor>): this;
29
29
  /**
30
30
  * Sets the color of the embed.
31
31
  * @param color - The color of the embed.
@@ -34,7 +34,7 @@ export declare class Embed {
34
34
  * embed.setColor('#FF0000');
35
35
  * embed.setColor('Blurple');
36
36
  */
37
- setColor(color: ColorResolvable): this;
37
+ setColor(color?: ColorResolvable): this;
38
38
  /**
39
39
  * Sets the description of the embed.
40
40
  * @param desc - The description of the embed.
@@ -42,7 +42,7 @@ export declare class Embed {
42
42
  * @example
43
43
  * embed.setDescription('This is the description of the embed');
44
44
  */
45
- setDescription(desc: string): this;
45
+ setDescription(desc?: string): this;
46
46
  /**
47
47
  * Adds one or more fields to the embed.
48
48
  * @param fields - The fields to add to the embed.
@@ -58,7 +58,7 @@ export declare class Embed {
58
58
  * @example
59
59
  * embed.setFields([{ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' }]);
60
60
  */
61
- setFields(fields: APIEmbedField[]): this;
61
+ setFields(fields?: APIEmbedField[]): this;
62
62
  /**
63
63
  * Sets the footer of the embed.
64
64
  * @param footer - The footer information.
@@ -66,7 +66,7 @@ export declare class Embed {
66
66
  * @example
67
67
  * embed.setFooter({ text: 'This is the footer', iconURL: 'https://example.com/footer.png' });
68
68
  */
69
- setFooter(footer: ObjectToLower<Omit<APIEmbedFooter, 'proxy_icon_url'>>): this;
69
+ setFooter(footer?: ObjectToLower<Omit<APIEmbedFooter, 'proxy_icon_url'>>): this;
70
70
  /**
71
71
  * Sets the image of the embed.
72
72
  * @param url - The URL of the image.
@@ -74,7 +74,7 @@ export declare class Embed {
74
74
  * @example
75
75
  * embed.setImage('https://example.com/image.png');
76
76
  */
77
- setImage(url: string): this;
77
+ setImage(url?: string): this;
78
78
  /**
79
79
  * Sets the timestamp of the embed.
80
80
  * @param time - The timestamp value.
@@ -92,7 +92,7 @@ export declare class Embed {
92
92
  * @example
93
93
  * embed.setTitle('This is the title');
94
94
  */
95
- setTitle(title: string): this;
95
+ setTitle(title?: string): this;
96
96
  /**
97
97
  * Sets the URL of the embed.
98
98
  * @param url - The URL of the embed.
@@ -100,7 +100,7 @@ export declare class Embed {
100
100
  * @example
101
101
  * embed.setURL('https://seyfert.com');
102
102
  */
103
- setURL(url: string): this;
103
+ setURL(url?: string): this;
104
104
  /**
105
105
  * Sets the thumbnail of the embed.
106
106
  * @param url - The URL of the thumbnail.
@@ -32,7 +32,7 @@ class Embed {
32
32
  * embed.setAuthor({ name: 'John Doe', iconURL: 'https://example.com/avatar.png' });
33
33
  */
34
34
  setAuthor(author) {
35
- this.data.author = (0, common_1.toSnakeCase)(author);
35
+ this.data.author = author && (0, common_1.toSnakeCase)(author);
36
36
  return this;
37
37
  }
38
38
  /**
@@ -44,7 +44,7 @@ class Embed {
44
44
  * embed.setColor('Blurple');
45
45
  */
46
46
  setColor(color) {
47
- this.data.color = (0, common_1.resolveColor)(color);
47
+ this.data.color = color && (0, common_1.resolveColor)(color);
48
48
  return this;
49
49
  }
50
50
  /**
@@ -77,7 +77,7 @@ class Embed {
77
77
  * embed.setFields([{ name: 'Field 1', value: 'Value 1' }, { name: 'Field 2', value: 'Value 2' }]);
78
78
  */
79
79
  setFields(fields) {
80
- this.data.fields = fields;
80
+ this.data.fields = fields ?? [];
81
81
  return this;
82
82
  }
83
83
  /**
@@ -88,7 +88,7 @@ class Embed {
88
88
  * embed.setFooter({ text: 'This is the footer', iconURL: 'https://example.com/footer.png' });
89
89
  */
90
90
  setFooter(footer) {
91
- this.data.footer = (0, common_1.toSnakeCase)(footer);
91
+ this.data.footer = footer && (0, common_1.toSnakeCase)(footer);
92
92
  return this;
93
93
  }
94
94
  /**
@@ -99,7 +99,7 @@ class Embed {
99
99
  * embed.setImage('https://example.com/image.png');
100
100
  */
101
101
  setImage(url) {
102
- this.data.image = { url };
102
+ this.data.image = url ? { url } : undefined;
103
103
  return this;
104
104
  }
105
105
  /**
@@ -159,11 +159,13 @@ class Client extends base_1.BaseClient {
159
159
  break;
160
160
  case 'READY': {
161
161
  const ids = packet.d.guilds.map(x => x.id);
162
- this.__handleGuilds = this.__handleGuilds?.concat(ids) ?? ids;
162
+ if ((0, common_1.hasIntent)(this.gateway.options.intents, 'Guilds')) {
163
+ this.__handleGuilds = this.__handleGuilds?.concat(ids) ?? ids;
164
+ }
163
165
  this.botId = packet.d.user.id;
164
166
  this.applicationId = packet.d.application.id;
165
167
  this.me = transformers_1.Transformers.ClientUser(this, packet.d.user, packet.d.application);
166
- if (!this.__handleGuilds.length) {
168
+ if (!this.__handleGuilds?.length) {
167
169
  if ([...this.gateway.values()].every(shard => shard.data.session_id)) {
168
170
  await this.events?.runEvent('BOT_READY', this, this.me, -1);
169
171
  }
@@ -227,8 +227,10 @@ class WorkerClient extends base_1.BaseClient {
227
227
  return;
228
228
  shardsConnected++;
229
229
  const ids = payload.d.guilds.map(x => x.id);
230
- self.__handleGuildsResharding = self.__handleGuildsResharding?.concat(ids) ?? ids;
231
- if (shardsConnected === workerData.shards.length && !self.__handleGuildsResharding.length) {
230
+ if ((0, common_1.hasIntent)(workerData.intents, 'Guilds')) {
231
+ self.__handleGuildsResharding = self.__handleGuildsResharding?.concat(ids) ?? ids;
232
+ }
233
+ if (shardsConnected === workerData.shards.length && !self.__handleGuildsResharding?.length) {
232
234
  delete self.__handleGuildsResharding;
233
235
  self.postMessage({
234
236
  type: 'WORKER_READY_RESHARDING',
@@ -486,7 +488,9 @@ class WorkerClient extends base_1.BaseClient {
486
488
  case 'READY':
487
489
  {
488
490
  const ids = packet.d.guilds.map(x => x.id);
489
- this.__handleGuilds = this.__handleGuilds?.concat(ids) ?? ids;
491
+ if ((0, common_1.hasIntent)(this.workerData.intents, 'Guilds')) {
492
+ this.__handleGuilds = this.__handleGuilds?.concat(ids) ?? ids;
493
+ }
490
494
  this.botId = packet.d.user.id;
491
495
  this.applicationId = packet.d.application.id;
492
496
  this.me = transformers_1.Transformers.ClientUser(this, packet.d.user, packet.d.application);
@@ -42,6 +42,10 @@ export declare class ComponentContext<Type extends keyof ContextComponentCommand
42
42
  * @param ephemeral - Whether the reply should be ephemeral or not.
43
43
  */
44
44
  deferReply(ephemeral?: boolean): Promise<undefined>;
45
+ /**
46
+ * ACK an interaction and edit the original message later; the user does not see a loading state
47
+ */
48
+ deferUpdate(): Promise<undefined>;
45
49
  /**
46
50
  * Edits the response of the interaction.
47
51
  * @param body - The updated body of the response.
@@ -50,6 +50,12 @@ class ComponentContext extends basecontext_1.BaseContext {
50
50
  deferReply(ephemeral = false) {
51
51
  return this.interaction.deferReply(ephemeral ? types_1.MessageFlags.Ephemeral : undefined);
52
52
  }
53
+ /**
54
+ * ACK an interaction and edit the original message later; the user does not see a loading state
55
+ */
56
+ deferUpdate() {
57
+ return this.interaction.deferUpdate();
58
+ }
53
59
  /**
54
60
  * Edits the response of the interaction.
55
61
  * @param body - The updated body of the response.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "seyfert",
3
- "version": "2.1.1-dev-11420062278.0",
3
+ "version": "2.1.1-dev-11464165753.0",
4
4
  "description": "The most advanced framework for discord bots",
5
5
  "main": "./lib/index.js",
6
6
  "module": "./lib/index.js",