seyfert 2.1.1-dev-12340785707.0 → 2.1.1-dev-12401160313.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/lib/events/handler.js
CHANGED
|
@@ -164,44 +164,29 @@ class EventHandler extends common_1.BaseHandler {
|
|
|
164
164
|
}
|
|
165
165
|
async runEvent(name, client, packet, shardId, runCache = true) {
|
|
166
166
|
const Event = this.values[name];
|
|
167
|
-
if (!Event) {
|
|
168
|
-
return runCache
|
|
169
|
-
? this.client.cache.onPacket({
|
|
170
|
-
t: name,
|
|
171
|
-
d: packet,
|
|
172
|
-
})
|
|
173
|
-
: undefined;
|
|
174
|
-
}
|
|
175
167
|
try {
|
|
176
|
-
if (Event.data.once && Event.fired) {
|
|
177
|
-
return
|
|
178
|
-
? this.client.cache.onPacket({
|
|
179
|
-
t: name,
|
|
180
|
-
d: packet,
|
|
181
|
-
})
|
|
182
|
-
: undefined;
|
|
168
|
+
if (!Event || (Event.data.once && Event.fired)) {
|
|
169
|
+
return;
|
|
183
170
|
}
|
|
184
171
|
Event.fired = true;
|
|
185
172
|
const hook = await RawEvents[name]?.(client, packet);
|
|
173
|
+
await Event.run(hook, client, shardId);
|
|
174
|
+
}
|
|
175
|
+
catch (e) {
|
|
176
|
+
await this.onFail(name, e);
|
|
177
|
+
}
|
|
178
|
+
finally {
|
|
186
179
|
if (runCache)
|
|
187
180
|
await this.client.cache.onPacket({
|
|
188
181
|
t: name,
|
|
189
182
|
d: packet,
|
|
190
183
|
});
|
|
191
|
-
await Event.run(hook, client, shardId);
|
|
192
|
-
}
|
|
193
|
-
catch (e) {
|
|
194
|
-
await this.onFail(name, e);
|
|
195
184
|
}
|
|
196
185
|
}
|
|
197
186
|
async runCustom(name, ...args) {
|
|
198
187
|
const Event = this.values[name];
|
|
199
|
-
if (!Event) {
|
|
200
|
-
// @ts-expect-error
|
|
201
|
-
return this.client.collectors.run(name, args, this.client);
|
|
202
|
-
}
|
|
203
188
|
try {
|
|
204
|
-
if (Event.data.once && Event.fired) {
|
|
189
|
+
if (!Event || (Event.data.once && Event.fired)) {
|
|
205
190
|
// @ts-expect-error
|
|
206
191
|
return this.client.collectors.run(name, args, this.client);
|
|
207
192
|
}
|
|
@@ -178,6 +178,8 @@ export interface ModalSubmitInteraction<FromGuild extends boolean = boolean> ext
|
|
|
178
178
|
}
|
|
179
179
|
export declare class ModalSubmitInteraction<FromGuild extends boolean = boolean> extends BaseInteraction<FromGuild> {
|
|
180
180
|
data: ObjectToLower<APIModalSubmission>;
|
|
181
|
+
update<WR extends boolean = false>(data: ComponentInteractionMessageUpdate, withResponse?: WR): Promise<When<WR, import("./Message").WebhookMessage, undefined>>;
|
|
182
|
+
deferUpdate<WR extends boolean = false>(withResponse?: WR): Promise<When<WR, import("./Message").WebhookMessage, undefined>>;
|
|
181
183
|
get customId(): string;
|
|
182
184
|
get components(): {
|
|
183
185
|
components: {
|
|
@@ -467,6 +467,17 @@ class MessageCommandInteraction extends ApplicationCommandInteraction {
|
|
|
467
467
|
}
|
|
468
468
|
exports.MessageCommandInteraction = MessageCommandInteraction;
|
|
469
469
|
let ModalSubmitInteraction = class ModalSubmitInteraction extends BaseInteraction {
|
|
470
|
+
update(data, withResponse) {
|
|
471
|
+
return this.reply({
|
|
472
|
+
type: types_1.InteractionResponseType.UpdateMessage,
|
|
473
|
+
data,
|
|
474
|
+
}, withResponse);
|
|
475
|
+
}
|
|
476
|
+
deferUpdate(withResponse) {
|
|
477
|
+
return this.reply({
|
|
478
|
+
type: types_1.InteractionResponseType.DeferredMessageUpdate,
|
|
479
|
+
}, withResponse);
|
|
480
|
+
}
|
|
470
481
|
get customId() {
|
|
471
482
|
return this.data.customId;
|
|
472
483
|
}
|