aboutsummaryrefslogtreecommitdiff
path: root/bot.js
diff options
context:
space:
mode:
Diffstat (limited to 'bot.js')
-rw-r--r--bot.js17
1 files changed, 14 insertions, 3 deletions
diff --git a/bot.js b/bot.js
index 7605bf0..27057c6 100644
--- a/bot.js
+++ b/bot.js
@@ -12,6 +12,12 @@ if (!fs.existsSync("./user/userdata.json")) fs.writeFileSync("./user/userdata.js
if (!fs.existsSync("./user/spoilers.json")) fs.writeFileSync("./user/spoilers.json", "{}");
if (!fs.existsSync("./user/servers.json")) fs.writeFileSync("./user/servers.json", "{}");
if (!fs.existsSync("./reports")) fs.mkdirSync("./reports");
+if (!fs.existsSync("./stats")) fs.mkdirSync("./stats");
+if (!fs.existsSync("./stats/commands.json")) fs.writeFileSync("./stats/commands.json", "{}");
+if (!fs.existsSync("./stats/ponies.json")) fs.writeFileSync("./stats/ponies.json", "{}");
+if (!fs.existsSync("./stats/buttons.json")) fs.writeFileSync("./stats/buttons.json", "{}");
+if (!fs.existsSync("./stats/menu.json")) fs.writeFileSync("./stats/menu.json", "{}");
+if (!fs.existsSync("./stats/queries.json")) fs.writeFileSync("./stats/queries.json", "{}");
const rest = new REST({ version: '9' }).setToken(fs.readFileSync("./config/token." + (require('fs').existsSync("./beta") ? "beta" : "stable") + ".txt").toString());
const { Client, Intents, MessageActionRow, MessageButton, MessageSelectMenu, MessageEmbed } = require('discord.js');
@@ -25,9 +31,14 @@ const buttonHandler = require('./handler/button');
const menuHandler = require('./handler/menu');
const errorHandler = require('./handler/errors');
-global.langs = JSON.parse(fs.readFileSync("./user/userdata.json"));
-global.spoils = JSON.parse(fs.readFileSync("./user/spoilers.json"));
-global.servers = JSON.parse(fs.readFileSync("./user/servers.json"));
+global.langs = JSON.parse(fs.readFileSync("./user/userdata.json").toString());
+global.spoils = JSON.parse(fs.readFileSync("./user/spoilers.json").toString());
+global.servers = JSON.parse(fs.readFileSync("./user/servers.json").toString());
+global.statsCommands = JSON.parse(fs.readFileSync("./stats/commands.json").toString());
+global.statsPonies = JSON.parse(fs.readFileSync("./stats/ponies.json").toString());
+global.statsButtons = JSON.parse(fs.readFileSync("./stats/buttons.json").toString());
+global.statsMenu = JSON.parse(fs.readFileSync("./stats/menu.json").toString());
+global.statsQueries = JSON.parse(fs.readFileSync("./stats/queries.json").toString());
global.cooldowns = {};
global.l = (en, fr, id, gid) => {