Export Readable Command Leaderboard

This commit is contained in:
Dragon Fire
2020-06-07 17:04:56 -04:00
parent 6aa4020927
commit f2caea1548
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -1,6 +1,6 @@
{ {
"name": "xiao", "name": "xiao",
"version": "116.2.4", "version": "116.2.5",
"description": "Your personal server companion.", "description": "Your personal server companion.",
"main": "Xiao.js", "main": "Xiao.js",
"scripts": { "scripts": {
+3 -3
View File
@@ -56,13 +56,13 @@ module.exports = class XiaoClient extends CommandoClient {
} }
exportCommandLeaderboard() { exportCommandLeaderboard() {
let text = '{'; let text = '{\n';
for (const command of this.registry.commands.values()) { for (const command of this.registry.commands.values()) {
if (command.uses === undefined) continue; if (command.uses === undefined) continue;
text += `"${command.name}":${command.uses},`; text += `\n "${command.name}":${command.uses},`;
} }
text = text.slice(0, -1); text = text.slice(0, -1);
text += '}'; text += '\n}\n';
const buf = Buffer.from(text); const buf = Buffer.from(text);
fs.writeFileSync(path.join(__dirname, '..', 'command-leaderboard.json'), buf, { fs.writeFileSync(path.join(__dirname, '..', 'command-leaderboard.json'), buf, {
encoding: 'utf8' encoding: 'utf8'