Huggingface api mode, support for editing system prompts, config refactor
This commit is contained in:
@@ -6,15 +6,20 @@ import path = require('node:path');
|
||||
const commands = [];
|
||||
// Grab all the command folders from the commands directory you created earlier
|
||||
const foldersPath = path.join(__dirname, 'commands');
|
||||
const commandFolders = fs.readdirSync(foldersPath);
|
||||
const commandFolders = fs.readdirSync(foldersPath, { withFileTypes: true });
|
||||
|
||||
for (const folder of commandFolders) {
|
||||
if (!folder.isDirectory()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
// Grab all the command files from the commands directory you created earlier
|
||||
const commandsPath = path.join(foldersPath, folder);
|
||||
const commandsPath = path.join(foldersPath, folder.name);
|
||||
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
|
||||
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
|
||||
for (const file of commandFiles) {
|
||||
const filePath = path.join(commandsPath, file);
|
||||
console.log('Reading command: ' + filePath);
|
||||
const command = require(filePath);
|
||||
commands.push(command.data.toJSON());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user