Changed TicketData Structure
This commit is contained in:
1 parent
e740c17837
commit
b6a0016f5f
4 files changed
+38
-27
No files matched your search
+19
-1
@@ -51,7 +51,11 @@ module.exports = new Command({
|
||||
}
|
||||
|
||||
// Ticket ID
|
||||
let ticketNumberID = TicketNumberID.pad(interaction.guild.id);
|
||||
let ticketNumberID = await TicketNumberID.pad();
|
||||
|
||||
let TicketData = await JSON.parse(
|
||||
fs.readFileSync("./Data/TicketData.json", "utf8")
|
||||
);
|
||||
|
||||
// Ticket Subject
|
||||
const TicketSubject =
|
||||
@@ -105,6 +109,20 @@ module.exports = new Command({
|
||||
type: "GUILD_TEXT",
|
||||
}
|
||||
);
|
||||
await TicketData.tickets.push({
|
||||
id: ticketChannel.id,
|
||||
name: ticketChannel.name,
|
||||
user: Author.id,
|
||||
number: ticketNumberID,
|
||||
reason: TicketSubject,
|
||||
});
|
||||
fs.writeFileSync(
|
||||
"./Data/TicketData.json",
|
||||
JSON.stringify(TicketData, null, 4),
|
||||
(err) => {
|
||||
if (err) console.error(err);
|
||||
}
|
||||
);
|
||||
|
||||
if (
|
||||
interaction.channel.name === supportbot.ReactionChannel ||
|
||||
|
||||
Reference in new issue
Block a user