From c347689ea3d2fb2c1fd1aba7ef2feda6a7b926d0 Mon Sep 17 00:00:00 2001 From: CorwinDev <88144943+CorwinDev@users.noreply.github.com> Date: Tue, 3 Jan 2023 19:25:19 +0100 Subject: [PATCH] Allow multiple time stats --- src/commands/serverstats/time.js | 19 +++++-------------- src/handlers/functions/functions.js | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/src/commands/serverstats/time.js b/src/commands/serverstats/time.js index de7ce64..d17093e 100644 --- a/src/commands/serverstats/time.js +++ b/src/commands/serverstats/time.js @@ -27,20 +27,11 @@ module.exports = async (client, interaction, args) => { }, ], }).then(async (channel) => { - Schema.findOne({ Guild: interaction.guild.id }, async (err, data) => { - if (data) { - data.Time = channel.id; - data.TimeZone = time; - data.save(); - } - else { - new Schema({ - Guild: interaction.guild.id, - TimeZone: time, - Time: channel.id - }).save(); - } - }) + new Schema({ + Guild: interaction.guild.id, + TimeZone: time, + Time: channel.id, + }).save(); client.succNormal({ text: `Voice channel count created!`, diff --git a/src/handlers/functions/functions.js b/src/handlers/functions/functions.js index cd76bdc..d8100a8 100644 --- a/src/handlers/functions/functions.js +++ b/src/handlers/functions/functions.js @@ -196,7 +196,7 @@ module.exports = async (client) => { } client.generateActivity = function (id, name, channel, interaction) { - fetch(`https://discord.com/api/v8/channels/${channel.id}/invites`, { + fetch(`https://discord.com/api/v10/channels/${channel.id}/invites`, { method: "POST", body: JSON.stringify({ max_age: 86400,