Ran prettier

This commit is contained in:
Noah committed 2021-10-23 20:12:04 -05:00
1 parent b681eb3cd2
commit cf610fbe49
12 files changed
+271 -226

No files matched your search

+7 -8
View File
@@ -5,17 +5,16 @@ const fs = require("fs");
const Discord = require("discord.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const yaml = require("js-yaml");
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
function RunFunction(client, ...eventArgs) {}
class Event {
constructor(event, runFunction) {
this.event = event;
this.run = runFunction;
}
constructor(event, runFunction) {
this.event = event;
this.run = runFunction;
}
}
module.exports = Event;
module.exports = Event;
+57 -43
View File
@@ -8,69 +8,83 @@ const Command = require("./Command.js");
const Client = require("./Client.js");
const Event = require("./Event.js");
const yaml = require('js-yaml');
const supportbot = yaml.load(fs.readFileSync('./Data/supportbot.yml', 'utf8'));
const yaml = require("js-yaml");
const supportbot = yaml.load(fs.readFileSync("./Data/supportbot.yml", "utf8"));
class TicketNumberID {
static pad(guildId) {
let n = this.get(guildId) + '';
let z = '0';
let width = 4;
setTimeout(() => {
this.set(guildId, this.get(guildId) + 1);
}, 50);
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
static pad(guildId) {
let n = this.get(guildId) + "";
let z = "0";
let width = 4;
setTimeout(() => {
this.set(guildId, this.get(guildId) + 1);
}, 50);
return n.length >= width ? n : new Array(width - n.length + 1).join(z) + n;
}
static get(guildId) {
let ticketnumberID = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
static get(guildId) {
let ticketnumberID = JSON.parse(
fs.readFileSync("./Data/TicketData.json", "utf8")
);
if (!ticketnumberID[guildId]) {
ticketnumberID[guildId] = {
id: 0
ticketnumberID[guildId] = {
id: 0,
};
fs.writeFileSync(
"./Data/TicketData.json",
JSON.stringify(ticketnumberID, null, 4),
(err) => {
if (err) console.log(err);
}
);
fs.writeFileSync("./Data/TicketData.json", JSON.stringify(ticketnumberID, null, 4), err => {
if (err) console.log(err);
});
return 0;
return 0;
} else {
return ticketnumberID[guildId].id;
return ticketnumberID[guildId].id;
}
}
}
static set(guildId, value) {
let ticketnumberID = JSON.parse(
fs.readFileSync("./Data/TicketData.json", "utf8")
);
static set(guildId, value) {
let ticketnumberID = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
ticketnumberID[guildId] = {
id: value
}
id: value,
};
fs.writeFileSync("./Data/TicketData.json", JSON.stringify(ticketnumberID, null, 4), err => {
fs.writeFileSync(
"./Data/TicketData.json",
JSON.stringify(ticketnumberID, null, 4),
(err) => {
if (err) console.log(err);
});
}
);
return value;
}
}
static reset(guildId) {
let ticketnumberID = JSON.parse(
fs.readFileSync("./Data/TicketData.json", "utf8")
);
static reset(guildId) {
let ticketnumberID = JSON.parse(fs.readFileSync("./Data/TicketData.json", "utf8"));
ticketnumberID[guildId] = {
id: 0
}
id: 0,
};
fs.writeFileSync("./Data/TicketData.json", JSON.stringify(ticketnumberID, null, 4), err => {
fs.writeFileSync(
"./Data/TicketData.json",
JSON.stringify(ticketnumberID, null, 4),
(err) => {
if (err) console.log(err);
});
}
);
return 0;
}
}
}
module.exports = TicketNumberID;
module.exports = TicketNumberID;