updates to concierge bot to support adding services and routes
This commit is contained in:
@@ -3,14 +3,14 @@ import { handleCommands } from './handle-commands';
|
||||
import { CommandInteraction, Constants, ModalSubmitInteraction, type ApplicationCommandStructure } from '@projectdysnomia/dysnomia';
|
||||
import { CommandHandler } from '../types';
|
||||
|
||||
let commands: Record<string, CommandHandler<ApplicationCommandStructure>>;
|
||||
let commands: Map<string, CommandHandler<ApplicationCommandStructure>>;
|
||||
|
||||
beforeEach(() => {
|
||||
commands = {};
|
||||
commands = new Map();
|
||||
});
|
||||
|
||||
afterEach(() => {
|
||||
commands = {};
|
||||
commands = new Map();
|
||||
});
|
||||
|
||||
mock.module('./command-helpers', () => ({
|
||||
@@ -20,7 +20,7 @@ mock.module('./command-helpers', () => ({
|
||||
test('handleCommands executes command when interaction is CommandInteraction and command exists', async () => {
|
||||
const mockExecute = mock(() => Promise.resolve());
|
||||
const mockCommand = { definition: { name: 'testCommand' } as any, execute: mockExecute };
|
||||
commands['testCommand'] = mockCommand;
|
||||
commands.set('testCommand', mockCommand);
|
||||
|
||||
const mockInteraction = {
|
||||
type: Constants.InteractionTypes.APPLICATION_COMMAND,
|
||||
@@ -36,7 +36,7 @@ test('handleCommands executes command when interaction is CommandInteraction and
|
||||
test('handleCommands executes command when interaction is CommandInteraction and command exists', async () => {
|
||||
const mockExecute = mock(() => Promise.resolve());
|
||||
const mockCommand = { definition: { name: 'testCommand' } as any, execute: mockExecute };
|
||||
commands['testCommand'] = mockCommand;
|
||||
commands.set('testCommand', mockCommand);
|
||||
|
||||
const mockInteraction = {
|
||||
type: Constants.InteractionTypes.MODAL_SUBMIT,
|
||||
|
||||
Reference in New Issue
Block a user