try fix again
This commit is contained in:
parent
432555e2fb
commit
33f103279d
2 changed files with 5 additions and 3 deletions
|
@ -368,8 +368,6 @@ export function slashModule() {
|
|||
return function (client: Client | SlashClient, prop: string) {
|
||||
if (client._decoratedSlashModules === undefined)
|
||||
client._decoratedSlashModules = []
|
||||
|
||||
const mod = ((client as unknown) as { [key: string]: any })[prop]
|
||||
client._decoratedSlashModules.push(mod)
|
||||
client._decoratedSlashModules.push(prop)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -398,6 +398,10 @@ export class SlashClient {
|
|||
if (this._decoratedSlashModules !== undefined) {
|
||||
this._decoratedSlashModules.forEach((e) => {
|
||||
const mod = ((this as unknown) as { [name: string]: SlashModule })[e]
|
||||
if (!(mod instanceof SlashModule))
|
||||
throw new Error(
|
||||
'@slashModule can only be used on SlashModule instances'
|
||||
)
|
||||
this.modules.push(mod)
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue