fix(helpers): runtime error with mixer

This commit is contained in:
socram03 2023-06-06 14:34:05 +00:00
parent a49f3e9e42
commit 5cd1f56788
2 changed files with 5 additions and 4 deletions

View File

@ -23,7 +23,8 @@
} }
}, },
"dependencies": { "dependencies": {
"@biscuitland/common": "^0.0.4" "@biscuitland/common": "^0.0.4",
"ts-mixer": "^6.0.3"
}, },
"devDependencies": { "devDependencies": {
"@types/node": "^18.7.14", "@types/node": "^18.7.14",
@ -72,4 +73,4 @@
"publishConfig": { "publishConfig": {
"access": "public" "access": "public"
} }
} }

View File

@ -2,10 +2,10 @@ import {
ApplicationCommandType, ApplicationCommandType,
PermissionFlagsBits, PermissionFlagsBits,
RESTPostAPIChatInputApplicationCommandsJSONBody, RESTPostAPIChatInputApplicationCommandsJSONBody,
applyToClass
} from '@biscuitland/common'; } from '@biscuitland/common';
import { AllSlashOptions, SlashSubcommandGroupOption, SlashSubcommandOption } from './SlashCommandOption'; import { AllSlashOptions, SlashSubcommandGroupOption, SlashSubcommandOption } from './SlashCommandOption';
import { PermissionsStrings } from '../../Utils'; import { PermissionsStrings } from '../../Utils';
import { Mixin } from 'ts-mixer';
class SlashCommandB { class SlashCommandB {
constructor(public data: Partial<RESTPostAPIChatInputApplicationCommandsJSONBody> = {}) {} constructor(public data: Partial<RESTPostAPIChatInputApplicationCommandsJSONBody> = {}) {}
@ -53,5 +53,5 @@ class SlashCommandB {
} }
} }
export const SlashCommand = applyToClass(SlashSubcommandOption, SlashCommandB, ['toJSON']); export const SlashCommand = Mixin(SlashCommandB, SlashSubcommandOption);
export type SlashCommand = InstanceType<typeof SlashCommand>; export type SlashCommand = InstanceType<typeof SlashCommand>;