mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-04 22:16:08 +00:00
fix: collect.run types
This commit is contained in:
parent
865f863e53
commit
4c05c25a41
@ -7,11 +7,9 @@ import type { Button } from './Button';
|
|||||||
import type { TextInput } from './Modal';
|
import type { TextInput } from './Modal';
|
||||||
import type { BuilderSelectMenus } from './SelectMenu';
|
import type { BuilderSelectMenus } from './SelectMenu';
|
||||||
|
|
||||||
export type ComponentCallback = (
|
export type ComponentCallback<
|
||||||
interaction: ComponentInteraction | StringSelectMenuInteraction,
|
T extends ComponentInteraction | StringSelectMenuInteraction = ComponentInteraction | StringSelectMenuInteraction,
|
||||||
stop: ComponentStopCallback,
|
> = (interaction: T, stop: ComponentStopCallback, refresh: ComponentRefreshCallback) => any;
|
||||||
refresh: ComponentRefreshCallback,
|
|
||||||
) => any;
|
|
||||||
export type ComponentFilterCallback<T = ComponentInteraction> = (interaction: T) => any;
|
export type ComponentFilterCallback<T = ComponentInteraction> = (interaction: T) => any;
|
||||||
export type ComponentStopCallback = (reason?: string, refresh?: ComponentRefreshCallback) => any;
|
export type ComponentStopCallback = (reason?: string, refresh?: ComponentRefreshCallback) => any;
|
||||||
export type ComponentRefreshCallback = () => any;
|
export type ComponentRefreshCallback = () => any;
|
||||||
|
2
src/cache/resources/voice-states.ts
vendored
2
src/cache/resources/voice-states.ts
vendored
@ -1,4 +1,4 @@
|
|||||||
import type { GatewayVoiceState } from '../../common';
|
import type { GatewayVoiceState } from 'discord-api-types/v10';
|
||||||
import { GuildBasedResource } from './default/guild-based';
|
import { GuildBasedResource } from './default/guild-based';
|
||||||
|
|
||||||
export class VoiceStates extends GuildBasedResource<VoiceStateResource> {
|
export class VoiceStates extends GuildBasedResource<VoiceStateResource> {
|
||||||
|
@ -2,7 +2,7 @@ import type { ComponentCallback, ListenerOptions, ModalSubmitCallback } from '..
|
|||||||
import { LimitedCollection } from '../collection';
|
import { LimitedCollection } from '../collection';
|
||||||
import type { UsingClient } from '../commands';
|
import type { UsingClient } from '../commands';
|
||||||
import { BaseHandler, magicImport, type Logger, type OnFailCallback } from '../common';
|
import { BaseHandler, magicImport, type Logger, type OnFailCallback } from '../common';
|
||||||
import type { ComponentInteraction, ModalSubmitInteraction } from '../structures';
|
import type { ComponentInteraction, ModalSubmitInteraction, StringSelectMenuInteraction } from '../structures';
|
||||||
import { ComponentCommand, InteractionCommandType, ModalCommand } from './command';
|
import { ComponentCommand, InteractionCommandType, ModalCommand } from './command';
|
||||||
import { ComponentContext } from './componentcontext';
|
import { ComponentContext } from './componentcontext';
|
||||||
|
|
||||||
@ -54,7 +54,15 @@ export class ComponentHandler extends BaseHandler {
|
|||||||
super(logger);
|
super(logger);
|
||||||
}
|
}
|
||||||
|
|
||||||
createComponentCollector(messageId: string, options: ListenerOptions = {}) {
|
createComponentCollector(
|
||||||
|
messageId: string,
|
||||||
|
options: ListenerOptions = {},
|
||||||
|
): {
|
||||||
|
run<
|
||||||
|
T extends ComponentInteraction | StringSelectMenuInteraction = ComponentInteraction | StringSelectMenuInteraction,
|
||||||
|
>(customId: string | string[] | RegExp, callback: ComponentCallback<T>): any;
|
||||||
|
stop(reason?: string): any;
|
||||||
|
} {
|
||||||
this.values.set(messageId, {
|
this.values.set(messageId, {
|
||||||
components: [],
|
components: [],
|
||||||
options,
|
options,
|
||||||
@ -85,6 +93,7 @@ export class ComponentHandler extends BaseHandler {
|
|||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
//@ts-expect-error generic
|
||||||
run: this.values.get(messageId)!.__run,
|
run: this.values.get(messageId)!.__run,
|
||||||
stop: (reason?: string) => {
|
stop: (reason?: string) => {
|
||||||
this.deleteValue(messageId);
|
this.deleteValue(messageId);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user