This commit is contained in:
jb
2026-09-06 11:29:23 -04:00
parent cb39431a11
commit 3e2fc920fb
43 changed files with 2124 additions and 128 deletions
+1 -1
View File
@@ -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,
+11 -7
View File
@@ -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);
+2 -2
View File
@@ -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;