updates
This commit is contained in:
@@ -57,7 +57,7 @@
|
||||
"typescript": "beta"
|
||||
},
|
||||
"dependencies": {
|
||||
"@star-kitten/util": "link:@star-kitten/util",
|
||||
"@star-kitten/util": "workspace:*",
|
||||
"@projectdysnomia/dysnomia": "github:projectdysnomia/dysnomia#dev",
|
||||
"date-fns": "^4.1.0",
|
||||
"fp-filters": "^0.5.4",
|
||||
|
||||
@@ -4,7 +4,7 @@ import { getCommandState } from './command-state';
|
||||
import { type ExecutableInteraction } from '../types/interaction.type';
|
||||
import type { CommandContext, CommandHandler, CommandOptions, PartialContext } from '../types';
|
||||
import { augmentInteraction, getCommandName } from './command-helpers';
|
||||
import { awaitMaybePromise } from '@star-kitten/util/promise';
|
||||
import { awaitMaybePromise } from '@star-kitten/util/promise.js';
|
||||
|
||||
export async function handleCommands(
|
||||
interaction: ExecutableInteraction,
|
||||
|
||||
@@ -23,6 +23,8 @@ import {
|
||||
type ThumbnailComponent,
|
||||
type ModalSubmitInteractionData,
|
||||
type FileUploadComponent,
|
||||
type InteractionModalContent,
|
||||
type InteractionResponseModal,
|
||||
} from '@projectdysnomia/dysnomia';
|
||||
|
||||
export type ActionRowItem = Button | StringSelectMenu | UserSelectMenu | RoleSelectMenu | MentionableSelectMenu | ChannelSelectMenu;
|
||||
@@ -330,13 +332,15 @@ export const label = (options: LabelOptions, component: LabelComponent['componen
|
||||
});
|
||||
|
||||
export const modal = (
|
||||
options: { custom_id?: string; title?: string },
|
||||
...components: Array<LabelComponent | ActionRow | TextDisplayComponent>
|
||||
): ModalSubmitInteractionData =>
|
||||
({
|
||||
type: 9 as any, // Modal type
|
||||
custom_id: options.custom_id ?? '',
|
||||
title: options.title ?? '',
|
||||
custom_id: string,
|
||||
title: string,
|
||||
...components: Array<((Omit<ActionRow, "components"> & {
|
||||
components: TextInput[];
|
||||
}) | LabelComponent | TextDisplayComponent)>
|
||||
): InteractionModalContent => ({
|
||||
type: Constants.InteractionResponseTypes.MODAL,
|
||||
custom_id ,
|
||||
title,
|
||||
components: components.filter((c) => c),
|
||||
} as any);
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { Client as DJSClient } from '@projectdysnomia/dysnomia';
|
||||
import kv, { asyncKV } from '@star-kitten/util/kv.js';
|
||||
import type { KVStore } from './kv-store.type.ts.ts';
|
||||
import type { Cache } from './cache.type.ts';
|
||||
import { registerCommands } from '../commands/handle-commands.ts';
|
||||
import type { Cache } from './cache.type.ts';
|
||||
import type { Client } from './client.ts';
|
||||
import type { KVStore } from './kv-store.type.ts.ts';
|
||||
|
||||
export interface DiscordBotOptions {
|
||||
token?: string;
|
||||
|
||||
Reference in New Issue
Block a user