Huggingface api mode, support for editing system prompts, config refactor

This commit is contained in:
James Shiffer
2025-01-29 09:39:59 +00:00
parent a361f110ec
commit 21a2b1d4d0
15 changed files with 1949 additions and 584 deletions

View File

@@ -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());
}