I am building a discord bot in TypeScript, but when i try to run it is failing to run even when the typescript compiler succeeds without errors
This is the error i am getting is
C:\Users\tigog\PhpstormProjects\Jace-DiscordJS\build\commands\utilities\botinfo.js:55
return _super.call(this, client, {
^
TypeError: Class constructor Command cannot be invoked without 'new'
at new botinfo (C:\Users\tigog\PhpstormProjects\Jace-DiscordJS\build\commands\utilities\botinfo.js:55:23)
at CommandRegistry.registerCommands (C:\Users\tigog\PhpstormProjects\Jace-DiscordJS\node_modules\discord.js-commando\src\registry.js:118:48)
at CommandRegistry.registerCommandsIn (C:\Users\tigog\PhpstormProjects\Jace-DiscordJS\node_modules\discord.js-commando\src\registry.js:173:15)
at Object.<anonymous> (C:\Users\tigog\PhpstormProjects\Jace-DiscordJS\build\index.js:37:4)
at Module._compile (internal/modules/cjs/loader.js:689:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:700:10)
at Module.load (internal/modules/cjs/loader.js:599:32)
at tryModuleLoad (internal/modules/cjs/loader.js:538:12)
at Function.Module._load (internal/modules/cjs/loader.js:530:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:742:12)
What i have tried so far is putting new in front of the constructor, tried another command (same result).
I think personally that the problem is related in the code written below.
export = class Help extends Commando.Command {
constructor(client: Commando.CommandoClient) {
super(client, {
name: 'help',
memberName: 'help',
group: 'utilities',
description: 'Get the help menu',
guildOnly: false,
});
}
What i was expecting was that the TypeScript compiler would throw a notice or an error or that the JS application would run as per usual.
if you need more code to help me, just ask.