Typescript error in @ApplyOptions

import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import type { Message } from 'discord.js';

@ApplyOptions<Command.Options>({
description: 'ping pong',
enabled: true
})
export class PingCommand extends Command {
public override async messageRun(message: Message) {
const msg = await message.channel.send('Ping?');

return msg.edit(
`Pong! Client Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${msg.createdTimestamp - message.createdTimestamp}ms.`
);
}
}
import { ApplyOptions } from '@sapphire/decorators';
import { Command } from '@sapphire/framework';
import type { Message } from 'discord.js';

@ApplyOptions<Command.Options>({
description: 'ping pong',
enabled: true
})
export class PingCommand extends Command {
public override async messageRun(message: Message) {
const msg = await message.channel.send('Ping?');

return msg.edit(
`Pong! Client Latency ${Math.round(this.container.client.ws.ping)}ms. API Latency ${msg.createdTimestamp - message.createdTimestamp}ms.`
);
}
}
error from typescript lang server:
nable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.ts(1238)
nable to resolve signature of class decorator when called as an expression.
The runtime will invoke the decorator with 2 arguments, but the decorator expects 1.ts(1238)
Any help would be appreciated.
No description
Solution:
Enable experimental decorators thingy in tsconfig
Jump to solution
5 Replies
Favna
Favna10mo ago
I should probably make a @Spinel tag for this
Ayuz
AyuzOP10mo ago
Yeah I've set the target to ES2016, still the issue persists
Solution
MRDGH2821
MRDGH282110mo ago
Enable experimental decorators thingy in tsconfig
Ayuz
AyuzOP10mo ago
Omg, thanks, that fixed it!
Want results from more Discord servers?
Add your server