Cant find the template

.sapphirerc.json
{
"projectLanguage": "ts",
"locations": {
"base": "src",
"arguments": "arguments",
"commands": "commands",
"listeners": "listeners",
"preconditions": "preconditions"
},
"customFileTemplates": {
"enabled": true,
"location": "templates"
}
}
{
"projectLanguage": "ts",
"locations": {
"base": "src",
"arguments": "arguments",
"commands": "commands",
"listeners": "listeners",
"preconditions": "preconditions"
},
"customFileTemplates": {
"enabled": true,
"location": "templates"
}
}
34 Replies
Oreo ™
Oreo ™14mo ago
Favna
Favna14mo ago
because they were renamed to messagecommand, contextmenucommand and slashcommand in version 1.3.0
Oreo ™
Oreo ™14mo ago
but im trying to use a custom template
Favna
Favna14mo ago
oh i had not seen that my bad
Oreo ™
Oreo ™14mo ago
Any idea why its not working tho?
Favna
Favna14mo ago
@Swiizyy can you help here maybe? im quite busy and you've been doing a lot of CLI work @Swiizyy reping
Swiizyy
Swiizyy14mo ago
Sorry, I didn't have the time, I was at work when you pinged me yesterday :/ Hey, could you rename the file other than these names: command/commands. These names are not available
Oreo ™
Oreo ™14mo ago
i did msgcmd.ts.sapphire before, and it didnt work
Oreo ™
Oreo ™14mo ago
Oreo ™
Oreo ™14mo ago
yeah
Swiizyy
Swiizyy14mo ago
Mhhh it's strange that... @Oreo ™ Could you update the module to the latest version and try again?
Oreo ™
Oreo ™14mo ago
✖ Couldn't find a template file for that component type.
Swiizyy
Swiizyy14mo ago
@Favna I have the impression that the custom templates do not work...
Auric
Auric14mo ago
they should as they work for me my file is called command.ts.sapphire if that changes anything could it be the argument that you provide in the CLI?
Oreo ™
Oreo ™14mo ago
you mean using g instead of generate? ok yeah same error
Auric
Auric14mo ago
nah i mean after that command
Oreo ™
Oreo ™14mo ago
msgcmd?
Auric
Auric14mo ago
try msgcmd
Oreo ™
Oreo ™14mo ago
thats what i used here
Auric
Auric14mo ago
i mean try sapphire g msgcmd test
Oreo ™
Oreo ™14mo ago
Auric
Auric14mo ago
oh yeah so it should be command you wanna try renaming msgcmd.ts.sapphire to command.ts.sapphire
Oreo ™
Oreo ™14mo ago
ok
Oreo ™
Oreo ™14mo ago
Oreo ™
Oreo ™14mo ago
.
Auric
Auric14mo ago
can i see the contents of msgcmd.ts.sapphire and i want to see the location of the templates folder
Oreo ™
Oreo ™14mo ago
{
"category": "commands"
}
---
import { ApplyOptions } from '@sapphire/decorators';
import { MyExtendedCommand } from './somewhere';
import { Message } from 'discord.js';

@ApplyOptions<MyExtendedCommand.Options>({
description: 'A basic command'
})
export class {{name}}Command extends MyExtendedCommand {
public async messageRun(message: Message) {
return message.channel.send('Hello world!');
}
}
{
"category": "commands"
}
---
import { ApplyOptions } from '@sapphire/decorators';
import { MyExtendedCommand } from './somewhere';
import { Message } from 'discord.js';

@ApplyOptions<MyExtendedCommand.Options>({
description: 'A basic command'
})
export class {{name}}Command extends MyExtendedCommand {
public async messageRun(message: Message) {
return message.channel.send('Hello world!');
}
}
Oreo ™
Oreo ™14mo ago
Oreo ™
Oreo ™14mo ago
this is just the template this i tried one with valid typescript same error
Auric
Auric14mo ago
that's strange i dont see any issues
Oreo ™
Oreo ™14mo ago
do you use yaml or json
Auric
Auric14mo ago
json
Oreo ™
Oreo ™14mo ago
ok no idea why my one isnt working what version is your cli
Auric
Auric14mo ago
latest havent used it in a while tho my bot's source code is on my profile if you want a reference