Update TicketNumber.js

This commit is contained in:
ItzEmerald authored and GitHub committed 2020-01-29 20:05:34 +00:00
1 parent d77e9842aa
commit 5089a19a56
1 file changed
+11 -11
+11 -11
View File
@@ -21,14 +21,14 @@ class TicketNumberID {
static get(guildId) { static get(guildId) {
let ticketIds = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8")); let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
if (!ticketIds[guildId]) { if (!ticketnumberID[guildId]) {
ticketIds[guildId] = { ticketnumberID[guildId] = {
id: 0 id: 0
} }
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketIds, null, 4), err => { fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
if (err) console.log(err); if (err) console.log(err);
}); });
@@ -36,18 +36,18 @@ class TicketNumberID {
} else { } else {
return ticketIds[guildId].id; return ticketnumberID[guildId].id;
} }
} }
static set(guildId, value) { static set(guildId, value) {
let ticketIds = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8")); let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
ticketIds[guildId] = { ticketnumberID[guildId] = {
id: value id: value
} }
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketIds, null, 4), err => { fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
if (err) console.log(err); if (err) console.log(err);
}); });
@@ -55,13 +55,13 @@ class TicketNumberID {
} }
static reset(guildId) { static reset(guildId) {
let ticketIds = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8")); let ticketnumberID = JSON.parse(fs.readFileSync("./storage/tickets.json", "utf8"));
ticketIds[guildId] = { ticketnumberID[guildId] = {
id: 0 id: 0
} }
fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketIds, null, 4), err => { fs.writeFileSync("./storage/tickets.json", JSON.stringify(ticketnumberID, null, 4), err => {
if (err) console.log(err); if (err) console.log(err);
}); });