From ac8bd7aed1bda83bb86c66429aa8b2bf8efa8671 Mon Sep 17 00:00:00 2001
From: Botis <barnekiel@gmail.com>
Date: Sun, 16 Jan 2022 19:52:49 +0100
Subject: [PATCH 01/29] maybe fix for /np @Anweisung

---
 src/commands/music/nowplaying.js | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/src/commands/music/nowplaying.js b/src/commands/music/nowplaying.js
index 9ab4668..09e5257 100644
--- a/src/commands/music/nowplaying.js
+++ b/src/commands/music/nowplaying.js
@@ -56,4 +56,17 @@ async function NPEmbed(interaction, player)
 		);
 
 	await replyBtnInteractionEmbed(interaction, '', `<:musicnote:930887306045435934> **Now Playing:** [${queue.current.title} by ${queue.current.author}](${queue.current.uri})\n**Duration:** ${bar} ${formatDuration(player.position)}|${formatDuration(queue.current.duration)}\n**Requested by:** ${queue.current.requester}`, `DARK_GREEN`, queue.current.displayThumbnail("mqdefault"), channelControlComponent);
+
+	const Interval = setInterval(() =>
+	{
+		const pos = formatDuration(player.position);
+		if (queue.current == undefined || interaction == undefined || player.position > (queue.current.duration - 5000))
+		{
+			editBtnInteractionEmbed(interaction, '', '**Player stopped or its not available anymore!', 'DARK_RED');
+			clearInterval(Interval);
+			return;
+		};
+		bar = generateProgressBar(player.position, queue.current.duration);
+		editBtnInteractionEmbed(interaction, '', `<:musicnote:930887306045435934> **Now Playing:** [${queue.current.title} by ${queue.current.author}](${queue.current.uri})\n**Duration:** ${bar} ${pos}|${formatDuration(queue.current.duration)}\n**Requested by:** ${queue.current.requester}`, `DARK_GREEN`, queue.current.displayThumbnail("mqdefault"));
+	}, 5000);
 };
\ No newline at end of file

From 0f6b315d16558626a2b3edb42edf5bdf2cbee2e6 Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Wed, 19 Jan 2022 08:34:04 +0100
Subject: [PATCH 02/29] added Necessary Intent

---
 src/golden.js | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/golden.js b/src/golden.js
index 78df031..d818f68 100644
--- a/src/golden.js
+++ b/src/golden.js
@@ -18,6 +18,7 @@ const client = new Client({
     Intents.FLAGS.GUILDS,
     Intents.FLAGS.GUILD_VOICE_STATES,
     Intents.FLAGS.GUILD_MESSAGES,
+    Intents.FLAGS.GUILD_MEMBERS,
   ],
 });
 
@@ -38,7 +39,8 @@ client.manager = new Manager({
     }),
   ],
   autoPlay: true,
-  send: (id, payload) => {
+  send: (id, payload) =>
+  {
     const guild = client.guilds.cache.get(id);
     if (guild) guild.shard.send(payload);
   },

From f59ed08f0efb4790a9b7cdad7cbe0ea8702f050b Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Wed, 19 Jan 2022 08:34:18 +0100
Subject: [PATCH 03/29] fixed Member count :)

---
 src/modules/activityModule/activityModule.js | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/src/modules/activityModule/activityModule.js b/src/modules/activityModule/activityModule.js
index b475c2f..fd6515d 100644
--- a/src/modules/activityModule/activityModule.js
+++ b/src/modules/activityModule/activityModule.js
@@ -11,6 +11,13 @@ module.exports = {
 
       client.guilds.fetch();
 
+      client.guilds.cache.forEach(guild =>
+      {
+        guild.members.fetch();
+      });
+
+      console.log(client.users.cache.size);
+
       activity.name = activity.name.replace(
         "/guildCacheSize/",
         client.guilds.cache.size
@@ -27,6 +34,6 @@ module.exports = {
       client.user.setActivity(`${activity.name}`, {
         type: activity.type,
       });
-    }, 60000);
+    }, 6000);
   },
 };

From 63ccfe12444972138be81ddccf19941e03c45d85 Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Wed, 19 Jan 2022 08:41:56 +0100
Subject: [PATCH 04/29] removed console log and fixed the Timer

---
 src/modules/activityModule/activityModule.js | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/src/modules/activityModule/activityModule.js b/src/modules/activityModule/activityModule.js
index fd6515d..1a5ae6b 100644
--- a/src/modules/activityModule/activityModule.js
+++ b/src/modules/activityModule/activityModule.js
@@ -16,8 +16,6 @@ module.exports = {
         guild.members.fetch();
       });
 
-      console.log(client.users.cache.size);
-
       activity.name = activity.name.replace(
         "/guildCacheSize/",
         client.guilds.cache.size
@@ -34,6 +32,6 @@ module.exports = {
       client.user.setActivity(`${activity.name}`, {
         type: activity.type,
       });
-    }, 6000);
+    }, 60000);
   },
 };

From 1773cbeeb6c77f5c53f19f106f0907209e347ac5 Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Fri, 21 Jan 2022 10:15:00 +0100
Subject: [PATCH 05/29] fixed one Error

---
 src/commands/music/autoplay.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/commands/music/autoplay.js b/src/commands/music/autoplay.js
index 149bda3..617ba5b 100644
--- a/src/commands/music/autoplay.js
+++ b/src/commands/music/autoplay.js
@@ -13,10 +13,10 @@ module.exports = {
 
         const channel = interaction.member.voice;
         if (!channel) return replyInteractionEmbed(interaction, '', 'Join a voice channel first.', 'DARK_RED');
-        if (channel.channel.id!= player.voiceChannel)
+        if (channel.channelId != player.voiceChannel)
             return replyInteractionEmbed(interaction, '', 'I\'ve to be in the same voice channel with you for toggling Autoplay.', 'DARK_RED');
 
-        player.set(`autoplay`, !player.get(`autoplay`))
+        player.set(`autoplay`, !player.get(`autoplay`));
 
         setEmbed(interaction.guild, player);
         return replyInteractionEmbed(interaction, '', `**${player.get(`autoplay`) ? "activated" : "deactivated"}** Autoplay`, 'DARK_GREEN');

From 26944ed0c709fa5c0c5c792e721928bd1894f558 Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Fri, 21 Jan 2022 10:15:22 +0100
Subject: [PATCH 06/29] improved autoplay

---
 src/events/music/queueEnd.js   | 28 ++++++++++++++++++++++++----
 src/events/music/trackStart.js | 17 ++++++++++++-----
 2 files changed, 36 insertions(+), 9 deletions(-)

diff --git a/src/events/music/queueEnd.js b/src/events/music/queueEnd.js
index 07a7eaf..b0fc1bc 100644
--- a/src/events/music/queueEnd.js
+++ b/src/events/music/queueEnd.js
@@ -4,10 +4,30 @@ module.exports = async (client, player) =>
 {
   if (player.get('autoplay'))
   {
-    const previoustrack = player.get("previoustrack");
-    const mixURL = `https://www.youtube.com/watch?v=${previoustrack.identifier}&list=RD${previoustrack.identifier}`;
-    const response = await player.search(mixURL, previoustrack.requester);
-    return player.play(response.tracks[Math.floor(Math.random() * response.tracks.length)]);
+    const prevtrack = player.get("prevtrack");
+    const prevMixURL = `https://www.youtube.com/watch?v=${prevtrack.identifier}&list=RD${prevtrack.identifier}`;
+    const prevResponse = await player.search(prevMixURL, 'Autoplay');
+
+    if (player.get('prevprevtrack'))
+    {
+      const prevprevtrack = player.get('prevprevtrack');
+      const prevprevMixURL = `https://www.youtube.com/watch?v=${prevprevtrack.identifier}&list=RD${prevprevtrack.identifier}`;
+      const prevprevResponse = await player.search(prevprevMixURL, 'Autoplay');
+      const equalSongs = [];
+      prevResponse.tracks.forEach(song =>
+      {
+        prevprevResponse.tracks.forEach(prevSong =>
+        {
+          if (song.identifier == prevSong.identifier && song.identifier != prevprevtrack.identifier)
+            equalSongs.push(song);
+        });
+        console.log(equalSongs.length);
+      });
+
+      if (equalSongs.length != 0)
+        return player.play(equalSongs[Math.floor(Math.random() * equalSongs.length)]);
+    }
+    return player.play(prevResponse.tracks[1]);
   }
 
   const guild = await client.guilds.fetch(player.guild);
diff --git a/src/events/music/trackStart.js b/src/events/music/trackStart.js
index 73c59ca..68d7b9d 100644
--- a/src/events/music/trackStart.js
+++ b/src/events/music/trackStart.js
@@ -1,12 +1,19 @@
 const { generateQueue, setEmbed } = require('../../modules/channelModule/channelModule');
 const format = require('format-duration');
 
-module.exports = async (client, player, track, payload) => {
-
+module.exports = async (client, player, track, payload) =>
+{
     const guild = await client.guilds.fetch(player.guild);
 
-    if(guild === undefined) return;
+    if (guild === undefined) return;
 
     setEmbed(guild, player);
-    player.set(`previoustrack`, track);
-}
+    if (!player.get('prevtrack'))
+        player.set(`prevtrack`, track);
+    else
+    {
+        const prevtrack = player.get('prevtrack');
+        player.set('prevprevtrack', prevtrack);
+        player.set('prevtrack', track);
+    }
+};

From d9af783ef05e4df2d0bad4b7052bdcc1949e869a Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Fri, 21 Jan 2022 10:16:07 +0100
Subject: [PATCH 07/29] removed console.log

---
 src/events/music/queueEnd.js | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/events/music/queueEnd.js b/src/events/music/queueEnd.js
index b0fc1bc..1f4dec0 100644
--- a/src/events/music/queueEnd.js
+++ b/src/events/music/queueEnd.js
@@ -21,7 +21,6 @@ module.exports = async (client, player) =>
           if (song.identifier == prevSong.identifier && song.identifier != prevprevtrack.identifier)
             equalSongs.push(song);
         });
-        console.log(equalSongs.length);
       });
 
       if (equalSongs.length != 0)

From 2da42af809dba8e39c592ab0f71879a37931cde1 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Fri, 21 Jan 2022 20:41:19 +0100
Subject: [PATCH 08/29] Switched to MariaDB and minor bug fixes

---
 data/example.env                             |  16 +-
 package.json                                 |   4 +-
 src/commands/information/status.js           |   3 +-
 src/commands/music/setup.js                  |  12 +-
 src/events/generic/interactionCreate.js      |   8 +-
 src/events/generic/messageCreate.js          |   2 +-
 src/events/generic/ready.js                  |  14 +-
 src/golden.js                                |  12 +-
 src/modules/activityModule/activityModule.js |   5 +-
 src/modules/channelModule/channelModule.js   |   6 +-
 src/modules/databaseModule/databaseModule.js | 205 +++++--
 yarn.lock                                    | 534 +++----------------
 12 files changed, 260 insertions(+), 561 deletions(-)

diff --git a/data/example.env b/data/example.env
index 947f603..995d2cc 100644
--- a/data/example.env
+++ b/data/example.env
@@ -3,14 +3,20 @@ TOKEN= "YOUR_BOT_TOKEN"
 APPID= "YOUR_APPLICATION_ID"
 GUILDID= "THE_GUILD_ID(FOR_DEVELOPMENT)"
 
+# Database
+DB_HOST="localhost"
+DB_PORT=3306
+DB_USERNAME=""
+DB_DATABASE=""
+DB_PASSWORD=""
 
 # LavaLink
-HOST=""
-PORT=2333
-PASSWORD=""
-SECURE=""
+LL_HOST=""
+LL_PORT=2333
+LL_PASSWORD=""
+LL_SECURE=false
 
-#Spotify --> https://developer.spotify.com/dashboard/
+# Spotify --> https://developer.spotify.com/dashboard/
 CLIENTID=""
 CLIENTSECRET=""
 
diff --git a/package.json b/package.json
index 15cf54c..08566fa 100644
--- a/package.json
+++ b/package.json
@@ -9,7 +9,6 @@
   "author": "Botis",
   "license": "ISC",
   "dependencies": {
-    "@devsnowflake/quick.db": "^2.0.3",
     "@discordjs/builders": "^0.9.0",
     "@discordjs/rest": "^0.1.0-canary.0",
     "better-uptime": "^1.1.4",
@@ -20,6 +19,7 @@
     "dotenv": "^10.0.0",
     "erela.js-spotify": "^1.2.0",
     "erela.js-vk": "^2.3.3-vk-8",
-    "format-duration": "^1.4.0"
+    "format-duration": "^1.4.0",
+    "mariadb": "^2.5.5"
   }
 }
diff --git a/src/commands/information/status.js b/src/commands/information/status.js
index 2852395..4611833 100644
--- a/src/commands/information/status.js
+++ b/src/commands/information/status.js
@@ -26,6 +26,7 @@ module.exports = {
     let seconds = Math.floor(totalSeconds % 60);
 
     const usage = process.cpuUsage();
+    const global = await getGlobal();
 
     interaction.editReply({
       embeds: [
@@ -83,7 +84,7 @@ module.exports = {
             },
             {
               name: "Music channels",
-              value: `${getGlobal().stats.goldenChannelCount}`,
+              value: `${global.value}`,
               inline: true,
             },
             {
diff --git a/src/commands/music/setup.js b/src/commands/music/setup.js
index 22aabec..7724ca2 100644
--- a/src/commands/music/setup.js
+++ b/src/commands/music/setup.js
@@ -1,5 +1,5 @@
 const { SlashCommandBuilder } = require("@discordjs/builders");
-const { setGuildChannel, setGuildChannelEmbed, setGuildChannelHero, increaseGlobalChannelCreation } = require("../../modules/databaseModule/databaseModule");
+const { setGuildChannel, setGuildChannelEmbed, setGuildChannelHero, increaseChannelCount } = require("../../modules/databaseModule/databaseModule");
 const {
   createChannel,
   channelExists,
@@ -33,7 +33,7 @@ module.exports = {
 
   async execute(interaction, client)
   {
-    if (!interaction.member.permissions.has("ADMINISTRATOR"))
+    if (!interaction.member.permissions.has("MANAGE_CHANNELS"))
       return replyInteractionEmbed(interaction, 'Missing permission', 'You need admin permission to do that.', 'DARK_RED', 'https://cdn.discordapp.com/attachments/922836431045525525/922841155098533928/warn.png');
 
     if (await channelExists(interaction.guild, "MUSIC_CHANNEL"))
@@ -46,10 +46,10 @@ module.exports = {
     }
 
     const channel = await createChannel(interaction.guild);
-    await setGuildChannel(interaction.guild.id, channel.id);
+    await setGuildChannel(interaction.guild.id, channel.id, interaction.guild.name);
     const { channelHero, channelEmbed } = await populateChannel(interaction.guild);
-    setGuildChannelEmbed(interaction.guild.id, channelEmbed.id);
-    setGuildChannelHero(interaction.guild.id, channelHero.id);
+    await setGuildChannelEmbed(interaction.guild.id, channelEmbed.id);
+    await setGuildChannelHero(interaction.guild.id, channelHero.id);
 
     client.manager.players.filter(async player =>
     {
@@ -61,7 +61,7 @@ module.exports = {
       setEmbed(guild, player);
     });
 
-    increaseGlobalChannelCreation();
+    increaseChannelCount();
     return interaction.reply({
       embeds: [createEmbed('Channel creation successful', `I\'ve created my new channel successfully ${channel}\nJust send any track url or name into the channel and I'll do the rest.`, 'DARK_GREEN', 'https://cdn.discordapp.com/attachments/922836431045525525/922846375312498698/pop.png')],
       ephemeral: true
diff --git a/src/events/generic/interactionCreate.js b/src/events/generic/interactionCreate.js
index 51d19fc..795f49f 100644
--- a/src/events/generic/interactionCreate.js
+++ b/src/events/generic/interactionCreate.js
@@ -3,7 +3,7 @@ const {
   setGuildChannel,
   setGuildChannelEmbed,
   setGuildChannelHero,
-  increaseGlobalChannelCreation
+  increaseChannelCount
 } = require("../../modules/databaseModule/databaseModule");
 const {
   createChannel,
@@ -37,7 +37,7 @@ module.exports = {
         // channel setup components
         case "cancelDeleteChannel":
           return interaction.update({
-            embeds: [createEmbed('Channel creation cancelled', `Okay, I'll stick with my current channel <#${getGuildChannel(interaction.guild.id)}>`, 'DARKER_GREY', 'https://cdn.discordapp.com/attachments/922836431045525525/922846375312498698/pop.png')],
+            embeds: [createEmbed('Channel creation cancelled', `Okay, I'll stick with my current channel <#${await getGuildChannel(interaction.guild.id)}>`, 'DARKER_GREY', 'https://cdn.discordapp.com/attachments/922836431045525525/922846375312498698/pop.png')],
             components: [],
           });
 
@@ -45,7 +45,7 @@ module.exports = {
           await deleteChannel(interaction.guild);
 
           const channel = await createChannel(interaction.guild);
-          await setGuildChannel(interaction.guild.id, channel.id);
+          await setGuildChannel(interaction.guild.id, channel.id, interaction.guild.name);
           const { channelHero, channelEmbed } = await populateChannel(interaction.guild);
           if(channelHero && channelEmbed === undefined) return interaction.deferUpdate();
           setGuildChannelEmbed(interaction.guild.id, channelEmbed.id);
@@ -60,7 +60,7 @@ module.exports = {
             setEmbed(guild, player);
           });
 
-          increaseGlobalChannelCreation();
+          increaseChannelCount();
           return interaction.update({
             embeds: [createEmbed('Channel creation successful', `I\'ve created my new channel successfully ${channel}\nJust send any track url or name into the channel and I'll do the rest.`, 'DARK_GREEN', 'https://cdn.discordapp.com/attachments/922836431045525525/922846375312498698/pop.png')],
             components: []
diff --git a/src/events/generic/messageCreate.js b/src/events/generic/messageCreate.js
index b91a8a9..e79413d 100644
--- a/src/events/generic/messageCreate.js
+++ b/src/events/generic/messageCreate.js
@@ -9,7 +9,7 @@ module.exports = {
   once: false,
   async execute(message, client) {
 
-    if (channelExists(message.guild) && getGuildChannel(message.guild.id) === message.channel.id) {
+    if (channelExists(message.guild) && await getGuildChannel(message.guild.id) === message.channel.id) {
       if (message.author.bot) return;
 
       const missingPermissions = checkPermissions(message);
diff --git a/src/events/generic/ready.js b/src/events/generic/ready.js
index 6966228..5101974 100644
--- a/src/events/generic/ready.js
+++ b/src/events/generic/ready.js
@@ -1,7 +1,8 @@
 const { resetChannel, channelEmbedExists } = require('../../modules/channelModule/channelModule');
-const { getAll } = require('../../modules/databaseModule/databaseModule');
+const { getAllGuilds } = require('../../modules/databaseModule/databaseModule');
 const { setRandomActivities } = require('../../modules/activityModule/activityModule');
 const { Uptime } = require('better-uptime');
+const { createTables } = require('../../modules/databaseModule/databaseModule')
 
 module.exports = {
     name: 'ready',
@@ -19,16 +20,17 @@ module.exports = {
         );
         console.log('╰' + '─'.repeat(65) + '╯');
 
-        const registeredGuilds = getAll();
+        await createTables(); // create tables if not exists
+
+        const registeredGuilds = await getAllGuilds();
 
         for (const guild of registeredGuilds)
         {
-            const guildId = guild.ID;
-            const cachedGuild = client.guilds.cache.get(guildId);
+            const guildId = guild.guildId;
+            const cachedGuild = await client.guilds.cache.get(guildId);
+
             if (cachedGuild !== undefined && await channelEmbedExists(guildId, client))
-            {
                 resetChannel(cachedGuild);
-            }
         }
 
         if (process.env.URL.includes('http'))
diff --git a/src/golden.js b/src/golden.js
index d818f68..3fcffe8 100644
--- a/src/golden.js
+++ b/src/golden.js
@@ -25,19 +25,19 @@ const client = new Client({
 client.manager = new Manager({
   nodes: [
     {
-      host: process.env.HOST,
-      port: Number(process.env.PORT),
-      password: process.env.PASSWORD,
+      host: process.env.LL_HOST,
+      port: Number(process.env.LL_PORT),
+      password: process.env.LL_PASSWORD,
       retryDelay: 5000,
-      secure: Boolean(process.env.SECURE)
+      secure: process.env.LL_SECURE === "true" ? true : false
     },
   ],
-  plugins: [
+  /*plugins: [
     new Spotify({
       clientID: process.env.CLIENTID,
       clientSecret: process.env.CLIENTSECRET,
     }),
-  ],
+  ],*/
   autoPlay: true,
   send: (id, payload) =>
   {
diff --git a/src/modules/activityModule/activityModule.js b/src/modules/activityModule/activityModule.js
index 1a5ae6b..ee00dfd 100644
--- a/src/modules/activityModule/activityModule.js
+++ b/src/modules/activityModule/activityModule.js
@@ -4,8 +4,9 @@ const { getGlobal } = require("../databaseModule/databaseModule");
 module.exports = {
   setRandomActivities: async function (client)
   {
-    setInterval(() =>
+    setInterval(async () =>
     {
+      const global = await getGlobal();
       const activity =
         activities[Math.floor(Math.random() * activities.length)];
 
@@ -26,7 +27,7 @@ module.exports = {
       );
       activity.name = activity.name.replace(
         "/goldenChannelCount/",
-        getGlobal().stats.goldenChannelCount
+        global.value
       );
 
       client.user.setActivity(`${activity.name}`, {
diff --git a/src/modules/channelModule/channelModule.js b/src/modules/channelModule/channelModule.js
index 5376620..d39c88c 100644
--- a/src/modules/channelModule/channelModule.js
+++ b/src/modules/channelModule/channelModule.js
@@ -1,5 +1,5 @@
 const {
-  hasGuildChannel,
+  guildExists,
   getGuildChannel,
   getGuildChannelEmbed,
 } = require('../databaseModule/databaseModule');
@@ -106,8 +106,8 @@ module.exports = {
   {
     const guildId = guild.id;
     return (
-      hasGuildChannel(guildId) &&
-      guild.channels.cache.get(getGuildChannel(guildId)) !== undefined
+      await guildExists(guildId) &&
+      guild.channels.cache.get(await getGuildChannel(guildId)) !== undefined
     );
   },
 
diff --git a/src/modules/databaseModule/databaseModule.js b/src/modules/databaseModule/databaseModule.js
index 2da893a..595a598 100644
--- a/src/modules/databaseModule/databaseModule.js
+++ b/src/modules/databaseModule/databaseModule.js
@@ -1,83 +1,186 @@
-const { Database } = require("@devsnowflake/quick.db");
-
-const db = new Database(__dirname + "/../../../data/data.db", {
-  path: __dirname + "/../../../data",
-  table: "ROOT",
+const mariadb = require('mariadb');
+const pool = mariadb.createPool({
+  host: process.env.DB_HOST,
+  user: process.env.DB_USERNAME,
+  password: process.env.DB_PASSWORD,
+  database: process.env.DB_DATABASE,
+  connectionLimit: 5,
+  multipleStatements: true
 });
 
 module.exports = {
-  createGuild: function (guildId) {
-    return db.set(guildId, {
-      musicChannel: "",
-      musicChannelHero: "",
-      musicChannelEmbed: "",
-    });
-  },
 
-  getAll: function () {
-    return db.all();
+  createTables: async function () {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      // TODO: change global table.., check connection in golden.js, maybe change setup icon buttons to yellow?
+      await conn.query("CREATE TABLE IF NOT EXISTS global(\
+                                    id VARCHAR(255) UNIQUE NOT NULL,\
+                                    value INT NOT NULL\
+                                  );\
+                                  INSERT IGNORE INTO global\
+                                    (id, value) VALUES ('channelCount', 0)\
+                                  ;\
+                                  CREATE TABLE IF NOT EXISTS guilds(\
+                                    id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\
+                                    guildId VARCHAR(255) UNIQUE NOT NULL,\
+                                    guildName VARCHAR(255),\
+                                    musicChannelId VARCHAR(255),\
+                                    musicChannelHeroId VARCHAR(255),\
+                                    musicChannelEmbedId VARCHAR(255)\
+                                  );", [1, "mariadb"]);
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
   },
 
-  getGuild: function (guildId) {
-    return db.get(guildId);
+  addGuildIfNotExists: async function (guildId, guildName) {
+    if (!await module.exports.guildExists(guildId)) module.exports.addGuild(guildId, guildName)
   },
 
-  hasGuild: function (guildId) {
-    return db.has(guildId);
+  addGuild: async function (guildId, guildName) {
+    console.log(guildName)
+    if (guildName === undefined) guildName = "Unknown";
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`INSERT INTO guilds\
+                                      (guildId, guildName) VALUES ('${guildId}', '${guildName}')\
+                                    ;`, [1, "mariadb"]);
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
   },
 
-  createGuildIfNotExists: function (guildId) {
-    if (!module.exports.hasGuild(guildId)) module.exports.createGuild(guildId);
+  getAllGuilds: async function () {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      const res = await conn.query('SELECT * FROM guilds;', [1, "mariadb"]);
+
+      if (conn) conn.end();
+      return res;
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    }
   },
 
-  setGuildChannel: function (guildId, channelId) {
-    module.exports.createGuildIfNotExists(guildId);
-    return db.set(`${guildId}.musicChannel`, channelId);
+  getGuild: async function (guildId) {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      const res = await conn.query(`SELECT * FROM guilds WHERE guildId = '${guildId}';`, [1, "mariadb"]);
+
+      if (conn) conn.end();
+      return res[0]
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    }
   },
 
-  setGuildChannelEmbed: function (guildId, messageId) {
-    module.exports.createGuildIfNotExists(guildId);
-    return db.set(`${guildId}.musicChannelEmbed`, messageId);
+  getGuildChannel: async function (guildId) {
+    const guild = await module.exports.getGuild(guildId);
+    return guild.musicChannelId;
   },
 
-  setGuildChannelHero: function (guildId, messageId) {
-    module.exports.createGuildIfNotExists(guildId);
-    return db.set(`${guildId}.musicChannelHero`, messageId);
+  getGuildChannelEmbed: async function (guildId) {
+    const guild = await module.exports.getGuild(guildId);
+    return guild.musicChannelEmbedId;
   },
 
-  getGuildChannel: function (guildId) {
-    return db.get(`${guildId}.musicChannel`);
+  guildExists: async function (guildId) {
+    return await module.exports.getGuild(guildId) === undefined ? false : true
   },
 
-  getGuildChannelEmbed: function (guildId) {
-    return db.get(`${guildId}.musicChannelEmbed`);
+  addGuildIfNotExists: async function (guildId, guildName) {
+    if (!await module.exports.guildExists(guildId)) module.exports.addGuild(guildId, guildName);
   },
 
-  getGuildChannelHero: function (guildId) {
-    return db.get(`${guildId}.musicChannelHero`);
+
+  setGuildChannel: async function (guildId, channelId, guildName) {
+    await module.exports.addGuildIfNotExists(guildId, guildName)
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE guilds SET musicChannelId = '${channelId}' WHERE guildId = '${guildId}';`, [1, "mariadb"]);
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
   },
 
-  hasGuildChannel: function (guildId, channelType) {
-    return db.get(`${guildId}.musicChannel`) !== "";
+  setGuildChannelHero: async function (guildId, messageId, guildName) {
+    await module.exports.addGuildIfNotExists(guildId, guildName)
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE guilds SET musicChannelHeroId = '${messageId}' WHERE guildId = '${guildId}';`, [1, "mariadb"]);
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
   },
 
-  createGlobalIfNotExist: function() {
-    if(!db.get('global'))
-      db.set('global', {
-        stats: {
-          goldenChannelCount: 0
-        }
-      });
+  setGuildChannelEmbed: async function (guildId, messageId, guildName) {
+    await module.exports.addGuildIfNotExists(guildId, guildName)
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE guilds SET musicChannelEmbedId = '${messageId}' WHERE guildId = '${guildId}';`, [1, "mariadb"]);
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
   },
 
-  getGlobal: function() {
-    module.exports.createGlobalIfNotExist();
-    return db.get('global');
+  getGlobal: async function () {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      const res = await conn.query(`SELECT * FROM global;`, [1, "mariadb"]);
+
+      if (conn) conn.end();
+      return res[0]
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    }
   },
 
-  increaseGlobalChannelCreation: function() {
-    module.exports.createGlobalIfNotExist();
-    db.set('global.stats.goldenChannelCount', db.get('global.stats.goldenChannelCount')+1);
+  increaseChannelCount: async function () {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE global SET value = value + 1 WHERE id = 'channelCount';`, [1, "mariadb"]);
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
   }
 
-};
+}
\ No newline at end of file
diff --git a/yarn.lock b/yarn.lock
index 90ce504..61530df 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -2,14 +2,6 @@
 # yarn lockfile v1
 
 
-"@devsnowflake/quick.db@^2.0.3":
-  version "2.0.3"
-  resolved "https://registry.yarnpkg.com/@devsnowflake/quick.db/-/quick.db-2.0.3.tgz#0e4e1b93e84cdbb1a418533efa70b85998afcb21"
-  integrity sha512-iJKNTG+icaPcqDW+5iRn1TjyA5XEUBXys035dMfnDoQtIQcObk4kB9hMKmILwvWMG2a5iyp99z9cxUxSFLUPwQ==
-  dependencies:
-    better-sqlite3 "^7.1.2"
-    lodash "^4.17.20"
-
 "@discordjs/builders@^0.11.0":
   version "0.11.0"
   resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-0.11.0.tgz#4102abe3e0cd093501f3f71931df43eb92f5b0cc"
@@ -88,6 +80,11 @@
   dependencies:
     defer-to-connect "^1.0.1"
 
+"@types/geojson@^7946.0.7":
+  version "7946.0.8"
+  resolved "https://registry.yarnpkg.com/@types/geojson/-/geojson-7946.0.8.tgz#30744afdb385e2945e22f3b033f897f76b1f12ca"
+  integrity sha512-1rkryxURpr6aWP7R786/UQOkJ3PcpQiWkAXBmdWc7ryFWqN6a4xfK7BtjXvFBKO9LjQ+MWQSWxYeZX1OApnArA==
+
 "@types/node-fetch@^2.5.12":
   version "2.5.12"
   resolved "https://registry.yarnpkg.com/@types/node-fetch/-/node-fetch-2.5.12.tgz#8a6f779b1d4e60b7a57fb6fd48d84fb545b9cc66"
@@ -101,6 +98,11 @@
   resolved "https://registry.yarnpkg.com/@types/node/-/node-17.0.8.tgz#50d680c8a8a78fe30abe6906453b21ad8ab0ad7b"
   integrity sha512-YofkM6fGv4gDJq78g4j0mMuGMkZVxZDgtU0JRdx6FgiJDG+0fY0GKVolOV8WqVmEhLCXkQRjwDdKyPxJp/uucg==
 
+"@types/node@^14.14.28":
+  version "14.18.9"
+  resolved "https://registry.yarnpkg.com/@types/node/-/node-14.18.9.tgz#0e5944eefe2b287391279a19b407aa98bd14436d"
+  integrity sha512-j11XSuRuAlft6vLDEX4RvhqC0KxNxx6QIyMXNb0vHHSNPXTPeiy3algESWmOOIzEtiEL0qiowPU3ewW9hHVa7Q==
+
 "@types/ws@^8.2.2":
   version "8.2.2"
   resolved "https://registry.yarnpkg.com/@types/ws/-/ws-8.2.2.tgz#7c5be4decb19500ae6b3d563043cd407bf366c21"
@@ -120,29 +122,6 @@ add-zero@^1.0.0:
   resolved "https://registry.yarnpkg.com/add-zero/-/add-zero-1.0.0.tgz#88e221696717f66db467672f3f9aa004de9f1a2c"
   integrity sha1-iOIhaWcX9m20Z2cvP5qgBN6fGiw=
 
-ansi-regex@^2.0.0:
-  version "2.1.1"
-  resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
-  integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=
-
-ansi-regex@^5.0.1:
-  version "5.0.1"
-  resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
-  integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
-
-aproba@^1.0.3:
-  version "1.2.0"
-  resolved "https://registry.yarnpkg.com/aproba/-/aproba-1.2.0.tgz#6802e6264efd18c790a1b0d517f0f2627bf2c94a"
-  integrity sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==
-
-are-we-there-yet@~1.1.2:
-  version "1.1.7"
-  resolved "https://registry.yarnpkg.com/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz#b15474a932adab4ff8a50d9adfa7e4e926f21146"
-  integrity sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==
-  dependencies:
-    delegates "^1.0.0"
-    readable-stream "^2.0.6"
-
 asynckit@^0.4.0:
   version "0.4.0"
   resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@@ -155,20 +134,6 @@ axios@^0.20.0:
   dependencies:
     follow-redirects "^1.10.0"
 
-base64-js@^1.3.1:
-  version "1.5.1"
-  resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a"
-  integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==
-
-better-sqlite3@^7.1.2:
-  version "7.4.6"
-  resolved "https://registry.yarnpkg.com/better-sqlite3/-/better-sqlite3-7.4.6.tgz#c5dc35c71bb9c9ef5d9e16019686371ff6a5f25e"
-  integrity sha512-LB/UxnMhcJY12bRCDXl2jTk0lsbXHCHOLn3cPjGhy3GCcVPGq45sCGJPUdfBZnfXGN14tYTJyq0ztUI3lGng8A==
-  dependencies:
-    bindings "^1.5.0"
-    prebuild-install "^7.0.0"
-    tar "^6.1.11"
-
 better-uptime@^1.1.4:
   version "1.1.4"
   resolved "https://registry.yarnpkg.com/better-uptime/-/better-uptime-1.1.4.tgz#b20f9265de7a2bf5402b926c4b0ed66c1fe934a7"
@@ -177,30 +142,6 @@ better-uptime@^1.1.4:
     ms "^2.1.3"
     node-fetch "^2.6.1"
 
-bindings@^1.5.0:
-  version "1.5.0"
-  resolved "https://registry.yarnpkg.com/bindings/-/bindings-1.5.0.tgz#10353c9e945334bc0511a6d90b38fbc7c9c504df"
-  integrity sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==
-  dependencies:
-    file-uri-to-path "1.0.0"
-
-bl@^4.0.3:
-  version "4.1.0"
-  resolved "https://registry.yarnpkg.com/bl/-/bl-4.1.0.tgz#451535264182bec2fbbc83a62ab98cf11d9f7b3a"
-  integrity sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==
-  dependencies:
-    buffer "^5.5.0"
-    inherits "^2.0.4"
-    readable-stream "^3.4.0"
-
-buffer@^5.5.0:
-  version "5.7.1"
-  resolved "https://registry.yarnpkg.com/buffer/-/buffer-5.7.1.tgz#ba62e7c13133053582197160851a8f648e99eed0"
-  integrity sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==
-  dependencies:
-    base64-js "^1.3.1"
-    ieee754 "^1.1.13"
-
 cacheable-request@^6.0.0:
   version "6.1.0"
   resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-6.1.0.tgz#20ffb8bd162ba4be11e9567d823db651052ca912"
@@ -224,16 +165,6 @@ check-links@^1.1.8:
     p-map "^2.0.0"
     p-memoize "^2.1.0"
 
-chownr@^1.1.1:
-  version "1.1.4"
-  resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
-  integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==
-
-chownr@^2.0.0:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/chownr/-/chownr-2.0.0.tgz#15bfbe53d2eab4cf70f18a8cd68ebe5b3cb1dece"
-  integrity sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==
-
 clone-response@^1.0.2:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/clone-response/-/clone-response-1.0.2.tgz#d1dc973920314df67fbeb94223b4ee350239e96b"
@@ -241,11 +172,6 @@ clone-response@^1.0.2:
   dependencies:
     mimic-response "^1.0.0"
 
-code-point-at@^1.0.0:
-  version "1.1.0"
-  resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
-  integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
-
 combined-stream@^1.0.8:
   version "1.0.8"
   resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@@ -253,16 +179,6 @@ combined-stream@^1.0.8:
   dependencies:
     delayed-stream "~1.0.0"
 
-console-control-strings@^1.0.0, console-control-strings@~1.1.0:
-  version "1.1.0"
-  resolved "https://registry.yarnpkg.com/console-control-strings/-/console-control-strings-1.1.0.tgz#3d7cf4464db6446ea644bf4b39507f9851008e8e"
-  integrity sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=
-
-core-util-is@~1.0.0:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.3.tgz#a6042d3634c2b27e9328f837b965fac83808db85"
-  integrity sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==
-
 decompress-response@^3.3.0:
   version "3.3.0"
   resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
@@ -270,18 +186,6 @@ decompress-response@^3.3.0:
   dependencies:
     mimic-response "^1.0.0"
 
-decompress-response@^6.0.0:
-  version "6.0.0"
-  resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-6.0.0.tgz#ca387612ddb7e104bd16d85aab00d5ecf09c66fc"
-  integrity sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==
-  dependencies:
-    mimic-response "^3.1.0"
-
-deep-extend@^0.6.0:
-  version "0.6.0"
-  resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac"
-  integrity sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==
-
 defer-to-connect@^1.0.1:
   version "1.1.3"
   resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-1.1.3.tgz#331ae050c08dcf789f8c83a7b81f0ed94f4ac591"
@@ -292,15 +196,10 @@ delayed-stream@~1.0.0:
   resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619"
   integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk=
 
-delegates@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/delegates/-/delegates-1.0.0.tgz#84c6e159b81904fdca59a0ef44cd870d31250f9a"
-  integrity sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=
-
-detect-libc@^1.0.3:
-  version "1.0.3"
-  resolved "https://registry.yarnpkg.com/detect-libc/-/detect-libc-1.0.3.tgz#fa137c4bd698edf55cd5cd02ac559f91a4c4ba9b"
-  integrity sha1-+hN8S9aY7fVc1c0CrFWfkaTEups=
+denque@^1.5.0:
+  version "1.5.1"
+  resolved "https://registry.yarnpkg.com/denque/-/denque-1.5.1.tgz#07f670e29c9a78f8faecb2566a1e2c11929c5cbf"
+  integrity sha512-XwE+iZ4D6ZUB7mfYRMb5wByE8L74HCn30FBN7sWnXksWc1LO1bPDl67pBR9o/kC4z/xSNAwkMYcGgqDV3BE3Hw==
 
 discord-api-types@^0.18.1:
   version "0.18.1"
@@ -355,12 +254,7 @@ duplexer3@^0.1.4:
   resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2"
   integrity sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=
 
-emoji-regex@^8.0.0:
-  version "8.0.0"
-  resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37"
-  integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==
-
-end-of-stream@^1.1.0, end-of-stream@^1.4.1:
+end-of-stream@^1.1.0:
   version "1.4.4"
   resolved "https://registry.yarnpkg.com/end-of-stream/-/end-of-stream-1.4.4.tgz#5ae64a5f45057baf3626ec14da0ca5e4b2431eb0"
   integrity sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==
@@ -398,16 +292,6 @@ event-target-shim@^5.0.0:
   resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
   integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
 
-expand-template@^2.0.3:
-  version "2.0.3"
-  resolved "https://registry.yarnpkg.com/expand-template/-/expand-template-2.0.3.tgz#6e14b3fcee0f3a6340ecb57d2e8918692052a47c"
-  integrity sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==
-
-file-uri-to-path@1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz#553a7b8446ff6f684359c445f1e37a05dacc33dd"
-  integrity sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==
-
 follow-redirects@^1.10.0:
   version "1.14.7"
   resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
@@ -439,32 +323,6 @@ format-duration@^1.4.0:
     add-zero "^1.0.0"
     parse-ms "^1.0.1"
 
-fs-constants@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/fs-constants/-/fs-constants-1.0.0.tgz#6be0de9be998ce16af8afc24497b9ee9b7ccd9ad"
-  integrity sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==
-
-fs-minipass@^2.0.0:
-  version "2.1.0"
-  resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-2.1.0.tgz#7f5036fdbf12c63c169190cbe4199c852271f9fb"
-  integrity sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==
-  dependencies:
-    minipass "^3.0.0"
-
-gauge@~2.7.3:
-  version "2.7.4"
-  resolved "https://registry.yarnpkg.com/gauge/-/gauge-2.7.4.tgz#2c03405c7538c39d7eb37b317022e325fb018bf7"
-  integrity sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=
-  dependencies:
-    aproba "^1.0.3"
-    console-control-strings "^1.0.0"
-    has-unicode "^2.0.0"
-    object-assign "^4.1.0"
-    signal-exit "^3.0.0"
-    string-width "^1.0.1"
-    strip-ansi "^3.0.1"
-    wide-align "^1.1.0"
-
 get-stream@^4.1.0:
   version "4.1.0"
   resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-4.1.0.tgz#c1b255575f3dc21d59bfc79cd3d2b46b1c3a54b5"
@@ -479,11 +337,6 @@ get-stream@^5.1.0:
   dependencies:
     pump "^3.0.0"
 
-github-from-package@0.0.0:
-  version "0.0.0"
-  resolved "https://registry.yarnpkg.com/github-from-package/-/github-from-package-0.0.0.tgz#97fb5d96bfde8973313f20e8288ef9a167fa64ce"
-  integrity sha1-l/tdlr/eiXMxPyDoKI75oWf6ZM4=
-
 got@^9.6.0:
   version "9.6.0"
   resolved "https://registry.yarnpkg.com/got/-/got-9.6.0.tgz#edf45e7d67f99545705de1f7bbeeeb121765ed85"
@@ -501,48 +354,23 @@ got@^9.6.0:
     to-readable-stream "^1.0.0"
     url-parse-lax "^3.0.0"
 
-has-unicode@^2.0.0:
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/has-unicode/-/has-unicode-2.0.1.tgz#e0e6fe6a28cf51138855e086d1691e771de2a8b9"
-  integrity sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=
-
 http-cache-semantics@^4.0.0:
   version "4.1.0"
   resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
   integrity sha512-carPklcUh7ROWRK7Cv27RPtdhYhUsela/ue5/jKzjegVvXDqM2ILE9Q2BGn9JZJh1g87cp56su/FgQSzcWS8cQ==
 
-ieee754@^1.1.13:
-  version "1.2.1"
-  resolved "https://registry.yarnpkg.com/ieee754/-/ieee754-1.2.1.tgz#8eb7a10a63fff25d15a57b001586d177d1b0d352"
-  integrity sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==
-
-inherits@^2.0.3, inherits@^2.0.4, inherits@~2.0.3:
-  version "2.0.4"
-  resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c"
-  integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==
-
-ini@~1.3.0:
-  version "1.3.8"
-  resolved "https://registry.yarnpkg.com/ini/-/ini-1.3.8.tgz#a29da425b48806f34767a4efce397269af28432c"
-  integrity sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==
+iconv-lite@^0.6.3:
+  version "0.6.3"
+  resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.6.3.tgz#a52f80bf38da1952eb5c681790719871a1a72501"
+  integrity sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==
+  dependencies:
+    safer-buffer ">= 2.1.2 < 3.0.0"
 
 is-absolute-url@^2.0.0:
   version "2.1.0"
   resolved "https://registry.yarnpkg.com/is-absolute-url/-/is-absolute-url-2.1.0.tgz#50530dfb84fcc9aa7dbe7852e83a37b93b9f2aa6"
   integrity sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=
 
-is-fullwidth-code-point@^1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz#ef9e31386f031a7f0d643af82fde50c457ef00cb"
-  integrity sha1-754xOG8DGn8NZDr4L95QxFfvAMs=
-  dependencies:
-    number-is-nan "^1.0.0"
-
-is-fullwidth-code-point@^3.0.0:
-  version "3.0.0"
-  resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz#f116f8064fe90b3f7844a38997c0b75051269f1d"
-  integrity sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==
-
 is-relative-url@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/is-relative-url/-/is-relative-url-2.0.0.tgz#72902d7fe04b3d4792e7db15f9db84b7204c9cef"
@@ -550,11 +378,6 @@ is-relative-url@^2.0.0:
   dependencies:
     is-absolute-url "^2.0.0"
 
-isarray@~1.0.0:
-  version "1.0.0"
-  resolved "https://registry.yarnpkg.com/isarray/-/isarray-1.0.0.tgz#bb935d48582cba168c06834957a54a3e07124f11"
-  integrity sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=
-
 json-buffer@3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/json-buffer/-/json-buffer-3.0.0.tgz#5b1f397afc75d677bde8bcfc0e47e1f9a3d9a898"
@@ -567,10 +390,10 @@ keyv@^3.0.0:
   dependencies:
     json-buffer "3.0.0"
 
-lodash@^4.17.20:
-  version "4.17.21"
-  resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c"
-  integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==
+long@^4.0.0:
+  version "4.0.0"
+  resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28"
+  integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==
 
 lowercase-keys@^1.0.0, lowercase-keys@^1.0.1:
   version "1.0.1"
@@ -582,13 +405,6 @@ lowercase-keys@^2.0.0:
   resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479"
   integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==
 
-lru-cache@^6.0.0:
-  version "6.0.0"
-  resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94"
-  integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==
-  dependencies:
-    yallist "^4.0.0"
-
 map-age-cleaner@^0.1.1:
   version "0.1.3"
   resolved "https://registry.yarnpkg.com/map-age-cleaner/-/map-age-cleaner-0.1.3.tgz#7d583a7306434c055fe474b0f45078e6e1b4b92a"
@@ -596,6 +412,19 @@ map-age-cleaner@^0.1.1:
   dependencies:
     p-defer "^1.0.0"
 
+mariadb@^2.5.5:
+  version "2.5.5"
+  resolved "https://registry.yarnpkg.com/mariadb/-/mariadb-2.5.5.tgz#a9aff9f1e57231a415a21254489439beb501c803"
+  integrity sha512-6dklvcKWuuaV1JjAwnE2ezR+jTt7JrZHftgeHHBmjB0wgfaUpdxol1DPWclwMcCrsO9yoM0FuCOiCcCgXc//9Q==
+  dependencies:
+    "@types/geojson" "^7946.0.7"
+    "@types/node" "^14.14.28"
+    denque "^1.5.0"
+    iconv-lite "^0.6.3"
+    long "^4.0.0"
+    moment-timezone "^0.5.33"
+    please-upgrade-node "^3.2.0"
+
 mem@^4.0.0:
   version "4.3.0"
   resolved "https://registry.yarnpkg.com/mem/-/mem-4.3.0.tgz#461af497bc4ae09608cdb2e60eefb69bff744178"
@@ -632,58 +461,23 @@ mimic-response@^1.0.0, mimic-response@^1.0.1:
   resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-1.0.1.tgz#4923538878eef42063cb8a3e3b0798781487ab1b"
   integrity sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==
 
-mimic-response@^3.1.0:
-  version "3.1.0"
-  resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9"
-  integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==
-
-minimist@^1.2.0, minimist@^1.2.3:
-  version "1.2.5"
-  resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.5.tgz#67d66014b66a6a8aaa0c083c5fd58df4e4e97602"
-  integrity sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==
-
-minipass@^3.0.0:
-  version "3.1.6"
-  resolved "https://registry.yarnpkg.com/minipass/-/minipass-3.1.6.tgz#3b8150aa688a711a1521af5e8779c1d3bb4f45ee"
-  integrity sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==
-  dependencies:
-    yallist "^4.0.0"
-
-minizlib@^2.1.1:
-  version "2.1.2"
-  resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-2.1.2.tgz#e90d3466ba209b932451508a11ce3d3632145931"
-  integrity sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==
+moment-timezone@^0.5.33:
+  version "0.5.34"
+  resolved "https://registry.yarnpkg.com/moment-timezone/-/moment-timezone-0.5.34.tgz#a75938f7476b88f155d3504a9343f7519d9a405c"
+  integrity sha512-3zAEHh2hKUs3EXLESx/wsgw6IQdusOT8Bxm3D9UrHPQR7zlMmzwybC8zHEM1tQ4LJwP7fcxrWr8tuBg05fFCbg==
   dependencies:
-    minipass "^3.0.0"
-    yallist "^4.0.0"
-
-mkdirp-classic@^0.5.2, mkdirp-classic@^0.5.3:
-  version "0.5.3"
-  resolved "https://registry.yarnpkg.com/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz#fa10c9115cc6d8865be221ba47ee9bed78601113"
-  integrity sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==
+    moment ">= 2.9.0"
 
-mkdirp@^1.0.3:
-  version "1.0.4"
-  resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e"
-  integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==
+"moment@>= 2.9.0":
+  version "2.29.1"
+  resolved "https://registry.yarnpkg.com/moment/-/moment-2.29.1.tgz#b2be769fa31940be9eeea6469c075e35006fa3d3"
+  integrity sha512-kHmoybcPV8Sqy59DwNDY3Jefr64lK/by/da0ViFcuA4DH0vQg5Q6Ze5VimxkfQNSC+Mls/Kx53s7TjP1RhFEDQ==
 
 ms@^2.1.3:
   version "2.1.3"
   resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.3.tgz#574c8138ce1d2b5861f0b44579dbadd60c6615b2"
   integrity sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==
 
-napi-build-utils@^1.0.1:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/napi-build-utils/-/napi-build-utils-1.0.2.tgz#b1fddc0b2c46e380a0b7a76f984dd47c41a13806"
-  integrity sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==
-
-node-abi@^3.3.0:
-  version "3.5.0"
-  resolved "https://registry.yarnpkg.com/node-abi/-/node-abi-3.5.0.tgz#26e8b7b251c3260a5ac5ba5aef3b4345a0229248"
-  integrity sha512-LtHvNIBgOy5mO8mPEUtkCW/YCRWYEKshIvqhe1GHHyXEHEB5mgICyYnAcl4qan3uFeRROErKGzatFHPf6kDxWw==
-  dependencies:
-    semver "^7.3.5"
-
 node-fetch@^2.6.1:
   version "2.6.6"
   resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.6.6.tgz#1751a7c01834e8e1697758732e9efb6eeadfaf89"
@@ -696,26 +490,6 @@ normalize-url@^4.1.0:
   resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-4.5.1.tgz#0dd90cf1288ee1d1313b87081c9a5932ee48518a"
   integrity sha512-9UZCFRHQdNrfTpGg8+1INIg93B6zE0aXMVFkw1WFwvO4SlZywU6aLg5Of0Ap/PgcbSw4LNxvMWXMeugwMCX0AA==
 
-npmlog@^4.0.1:
-  version "4.1.2"
-  resolved "https://registry.yarnpkg.com/npmlog/-/npmlog-4.1.2.tgz#08a7f2a8bf734604779a9efa4ad5cc717abb954b"
-  integrity sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==
-  dependencies:
-    are-we-there-yet "~1.1.2"
-    console-control-strings "~1.1.0"
-    gauge "~2.7.3"
-    set-blocking "~2.0.0"
-
-number-is-nan@^1.0.0:
-  version "1.0.1"
-  resolved "https://registry.yarnpkg.com/number-is-nan/-/number-is-nan-1.0.1.tgz#097b602b53422a522c1afb8790318336941a011d"
-  integrity sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=
-
-object-assign@^4.1.0:
-  version "4.1.1"
-  resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863"
-  integrity sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=
-
 once@^1.3.1, once@^1.4.0:
   version "1.4.0"
   resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1"
@@ -761,35 +535,18 @@ petitio@^1.1.0, petitio@^1.3.2:
   resolved "https://registry.yarnpkg.com/petitio/-/petitio-1.4.0.tgz#1887cba89b95de2c61ef774a2f1baf68845ba022"
   integrity sha512-9LaVd/5BLmbNU8Q4Ax8NezihiPt2ISNqi2vKilEchSSf+YSOXxfsLUb0SUmDskm1WkBOVTsqdyuyYI0RYKqr0Q==
 
-prebuild-install@^7.0.0:
-  version "7.0.0"
-  resolved "https://registry.yarnpkg.com/prebuild-install/-/prebuild-install-7.0.0.tgz#3c5ce3902f1cb9d6de5ae94ca53575e4af0c1574"
-  integrity sha512-IvSenf33K7JcgddNz2D5w521EgO+4aMMjFt73Uk9FRzQ7P+QZPKrp7qPsDydsSwjGt3T5xRNnM1bj1zMTD5fTA==
+please-upgrade-node@^3.2.0:
+  version "3.2.0"
+  resolved "https://registry.yarnpkg.com/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz#aeddd3f994c933e4ad98b99d9a556efa0e2fe942"
+  integrity sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==
   dependencies:
-    detect-libc "^1.0.3"
-    expand-template "^2.0.3"
-    github-from-package "0.0.0"
-    minimist "^1.2.3"
-    mkdirp-classic "^0.5.3"
-    napi-build-utils "^1.0.1"
-    node-abi "^3.3.0"
-    npmlog "^4.0.1"
-    pump "^3.0.0"
-    rc "^1.2.7"
-    simple-get "^4.0.0"
-    tar-fs "^2.0.0"
-    tunnel-agent "^0.6.0"
+    semver-compare "^1.0.0"
 
 prepend-http@^2.0.0:
   version "2.0.0"
   resolved "https://registry.yarnpkg.com/prepend-http/-/prepend-http-2.0.0.tgz#e92434bfa5ea8c19f41cdfd401d741a3c819d897"
   integrity sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=
 
-process-nextick-args@~2.0.0:
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/process-nextick-args/-/process-nextick-args-2.0.1.tgz#7820d9b16120cc55ca9ae7792680ae7dba6d7fe2"
-  integrity sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==
-
 pump@^3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/pump/-/pump-3.0.0.tgz#b4a2116815bde2f4e1ea602354e8c75565107a64"
@@ -798,38 +555,6 @@ pump@^3.0.0:
     end-of-stream "^1.1.0"
     once "^1.3.1"
 
-rc@^1.2.7:
-  version "1.2.8"
-  resolved "https://registry.yarnpkg.com/rc/-/rc-1.2.8.tgz#cd924bf5200a075b83c188cd6b9e211b7fc0d3ed"
-  integrity sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==
-  dependencies:
-    deep-extend "^0.6.0"
-    ini "~1.3.0"
-    minimist "^1.2.0"
-    strip-json-comments "~2.0.1"
-
-readable-stream@^2.0.6:
-  version "2.3.7"
-  resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-2.3.7.tgz#1eca1cf711aef814c04f62252a36a62f6cb23b57"
-  integrity sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==
-  dependencies:
-    core-util-is "~1.0.0"
-    inherits "~2.0.3"
-    isarray "~1.0.0"
-    process-nextick-args "~2.0.0"
-    safe-buffer "~5.1.1"
-    string_decoder "~1.1.1"
-    util-deprecate "~1.0.1"
-
-readable-stream@^3.1.1, readable-stream@^3.4.0:
-  version "3.6.0"
-  resolved "https://registry.yarnpkg.com/readable-stream/-/readable-stream-3.6.0.tgz#337bbda3adc0706bd3e024426a286d4b4b2c9198"
-  integrity sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==
-  dependencies:
-    inherits "^2.0.3"
-    string_decoder "^1.1.1"
-    util-deprecate "^1.0.1"
-
 responselike@^1.0.2:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/responselike/-/responselike-1.0.2.tgz#918720ef3b631c5642be068f15ade5a46f4ba1e7"
@@ -837,130 +562,15 @@ responselike@^1.0.2:
   dependencies:
     lowercase-keys "^1.0.0"
 
-safe-buffer@^5.0.1, safe-buffer@~5.2.0:
-  version "5.2.1"
-  resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
-  integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==
-
-safe-buffer@~5.1.0, safe-buffer@~5.1.1:
-  version "5.1.2"
-  resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
-  integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==
-
-semver@^7.3.5:
-  version "7.3.5"
-  resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.5.tgz#0b621c879348d8998e4b0e4be94b3f12e6018ef7"
-  integrity sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==
-  dependencies:
-    lru-cache "^6.0.0"
-
-set-blocking@~2.0.0:
-  version "2.0.0"
-  resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7"
-  integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc=
-
-signal-exit@^3.0.0:
-  version "3.0.6"
-  resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.6.tgz#24e630c4b0f03fea446a2bd299e62b4a6ca8d0af"
-  integrity sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==
-
-simple-concat@^1.0.0:
-  version "1.0.1"
-  resolved "https://registry.yarnpkg.com/simple-concat/-/simple-concat-1.0.1.tgz#f46976082ba35c2263f1c8ab5edfe26c41c9552f"
-  integrity sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==
-
-simple-get@^4.0.0:
-  version "4.0.0"
-  resolved "https://registry.yarnpkg.com/simple-get/-/simple-get-4.0.0.tgz#73fa628278d21de83dadd5512d2cc1f4872bd675"
-  integrity sha512-ZalZGexYr3TA0SwySsr5HlgOOinS4Jsa8YB2GJ6lUNAazyAu4KG/VmzMTwAt2YVXzzVj8QmefmAonZIK2BSGcQ==
-  dependencies:
-    decompress-response "^6.0.0"
-    once "^1.3.1"
-    simple-concat "^1.0.0"
-
-string-width@^1.0.1:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/string-width/-/string-width-1.0.2.tgz#118bdf5b8cdc51a2a7e70d211e07e2b0b9b107d3"
-  integrity sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=
-  dependencies:
-    code-point-at "^1.0.0"
-    is-fullwidth-code-point "^1.0.0"
-    strip-ansi "^3.0.0"
-
-"string-width@^1.0.2 || 2 || 3 || 4":
-  version "4.2.3"
-  resolved "https://registry.yarnpkg.com/string-width/-/string-width-4.2.3.tgz#269c7117d27b05ad2e536830a8ec895ef9c6d010"
-  integrity sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==
-  dependencies:
-    emoji-regex "^8.0.0"
-    is-fullwidth-code-point "^3.0.0"
-    strip-ansi "^6.0.1"
-
-string_decoder@^1.1.1:
-  version "1.3.0"
-  resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.3.0.tgz#42f114594a46cf1a8e30b0a84f56c78c3edac21e"
-  integrity sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==
-  dependencies:
-    safe-buffer "~5.2.0"
-
-string_decoder@~1.1.1:
-  version "1.1.1"
-  resolved "https://registry.yarnpkg.com/string_decoder/-/string_decoder-1.1.1.tgz#9cf1611ba62685d7030ae9e4ba34149c3af03fc8"
-  integrity sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==
-  dependencies:
-    safe-buffer "~5.1.0"
-
-strip-ansi@^3.0.0, strip-ansi@^3.0.1:
-  version "3.0.1"
-  resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf"
-  integrity sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=
-  dependencies:
-    ansi-regex "^2.0.0"
-
-strip-ansi@^6.0.1:
-  version "6.0.1"
-  resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9"
-  integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==
-  dependencies:
-    ansi-regex "^5.0.1"
-
-strip-json-comments@~2.0.1:
-  version "2.0.1"
-  resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-2.0.1.tgz#3c531942e908c2697c0ec344858c286c7ca0a60a"
-  integrity sha1-PFMZQukIwml8DsNEhYwobHygpgo=
-
-tar-fs@^2.0.0:
-  version "2.1.1"
-  resolved "https://registry.yarnpkg.com/tar-fs/-/tar-fs-2.1.1.tgz#489a15ab85f1f0befabb370b7de4f9eb5cbe8784"
-  integrity sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==
-  dependencies:
-    chownr "^1.1.1"
-    mkdirp-classic "^0.5.2"
-    pump "^3.0.0"
-    tar-stream "^2.1.4"
+"safer-buffer@>= 2.1.2 < 3.0.0":
+  version "2.1.2"
+  resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a"
+  integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==
 
-tar-stream@^2.1.4:
-  version "2.2.0"
-  resolved "https://registry.yarnpkg.com/tar-stream/-/tar-stream-2.2.0.tgz#acad84c284136b060dc3faa64474aa9aebd77287"
-  integrity sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==
-  dependencies:
-    bl "^4.0.3"
-    end-of-stream "^1.4.1"
-    fs-constants "^1.0.0"
-    inherits "^2.0.3"
-    readable-stream "^3.1.1"
-
-tar@^6.1.11:
-  version "6.1.11"
-  resolved "https://registry.yarnpkg.com/tar/-/tar-6.1.11.tgz#6760a38f003afa1b2ffd0ffe9e9abbd0eab3d621"
-  integrity sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==
-  dependencies:
-    chownr "^2.0.0"
-    fs-minipass "^2.0.0"
-    minipass "^3.0.0"
-    minizlib "^2.1.1"
-    mkdirp "^1.0.3"
-    yallist "^4.0.0"
+semver-compare@^1.0.0:
+  version "1.0.0"
+  resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
+  integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
 
 to-readable-stream@^1.0.0:
   version "1.0.0"
@@ -982,13 +592,6 @@ tslib@^2.3.0, tslib@^2.3.1:
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
   integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
 
-tunnel-agent@^0.6.0:
-  version "0.6.0"
-  resolved "https://registry.yarnpkg.com/tunnel-agent/-/tunnel-agent-0.6.0.tgz#27a5dea06b36b04a0a9966774b290868f0fc40fd"
-  integrity sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=
-  dependencies:
-    safe-buffer "^5.0.1"
-
 url-parse-lax@^3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"
@@ -996,11 +599,6 @@ url-parse-lax@^3.0.0:
   dependencies:
     prepend-http "^2.0.0"
 
-util-deprecate@^1.0.1, util-deprecate@~1.0.1:
-  version "1.0.2"
-  resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf"
-  integrity sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=
-
 webidl-conversions@^3.0.0:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/webidl-conversions/-/webidl-conversions-3.0.1.tgz#24534275e2a7bc6be7bc86611cc16ae0a5654871"
@@ -1014,13 +612,6 @@ whatwg-url@^5.0.0:
     tr46 "~0.0.3"
     webidl-conversions "^3.0.0"
 
-wide-align@^1.1.0:
-  version "1.1.5"
-  resolved "https://registry.yarnpkg.com/wide-align/-/wide-align-1.1.5.tgz#df1d4c206854369ecf3c9a4898f1b23fbd9d15d3"
-  integrity sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==
-  dependencies:
-    string-width "^1.0.2 || 2 || 3 || 4"
-
 wrappy@1:
   version "1.0.2"
   resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f"
@@ -1036,11 +627,6 @@ ws@^8.1.0, ws@^8.4.0:
   resolved "https://registry.yarnpkg.com/ws/-/ws-8.4.2.tgz#18e749868d8439f2268368829042894b6907aa0b"
   integrity sha512-Kbk4Nxyq7/ZWqr/tarI9yIt/+iNNFOjBXEWgTb4ydaNHBNGgvf2QHbS9fdfsndfjFlFwEd4Al+mw83YkaD10ZA==
 
-yallist@^4.0.0:
-  version "4.0.0"
-  resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
-  integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==
-
 zod@^3.11.6:
   version "3.11.6"
   resolved "https://registry.yarnpkg.com/zod/-/zod-3.11.6.tgz#e43a5e0c213ae2e02aefe7cb2b1a6fa3d7f1f483"

From 0a87f70a8212ad9e3018b92a0f5d93c2225c8ae6 Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Fri, 28 Jan 2022 13:29:48 +0100
Subject: [PATCH 09/29] enabled Spotify plugin

---
 src/golden.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/golden.js b/src/golden.js
index 3fcffe8..9e83998 100644
--- a/src/golden.js
+++ b/src/golden.js
@@ -32,12 +32,12 @@ client.manager = new Manager({
       secure: process.env.LL_SECURE === "true" ? true : false
     },
   ],
-  /*plugins: [
+  plugins: [
     new Spotify({
       clientID: process.env.CLIENTID,
       clientSecret: process.env.CLIENTSECRET,
     }),
-  ],*/
+  ],
   autoPlay: true,
   send: (id, payload) =>
   {

From 6684521a87fe171114b13c71cca1833f8929fb22 Mon Sep 17 00:00:00 2001
From: Barne Bellin <barnekiel@gmail.com>
Date: Fri, 28 Jan 2022 13:30:11 +0100
Subject: [PATCH 10/29] started Development for better skip command

---
 src/commands/music/skip.js | 48 +++++++++++++++++++++++++++-----------
 1 file changed, 35 insertions(+), 13 deletions(-)

diff --git a/src/commands/music/skip.js b/src/commands/music/skip.js
index 60e82e1..0923ae9 100644
--- a/src/commands/music/skip.js
+++ b/src/commands/music/skip.js
@@ -1,24 +1,46 @@
 const { SlashCommandBuilder } = require("@discordjs/builders");
-const { replyInteractionEmbed } = require("../../modules/channelModule/channelModule")
+const { replyInteractionEmbed } = require("../../modules/channelModule/channelModule");
 
 module.exports = {
   data: new SlashCommandBuilder()
     .setName("skip")
-    .setDescription("Skip current song"),
+    .setDescription("Skip current song")
+    .addIntegerOption((option) => option.setName('amount').setDescription('the amount of songs to be skipped'))
+    .addIntegerOption((option) => option.setName('queue_number').setDescription('the Number of the song in the Queue to which you want to Skip')),
 
-  async execute(interaction, client) {
+  async execute(interaction, client)
+  {
+    const amount = interaction.options.getString('amount');
+    const queue_number = interaction.options.getString('queue_number');
     const player = interaction.client.manager.get(interaction.guild.id);
-      if (!player) return replyInteractionEmbed(interaction, '', 'Play a track before using this command.', 'DARK_RED');
-  
-      const { channel } = interaction.member.voice;
-      if (!channel) return replyInteractionEmbed(interaction, '', 'Join a voice channel first.', 'DARK_RED');
-      if (channel.id !== player.voiceChannel) return replyInteractionEmbed(interaction, '', 'I\'ve to be in the same voice channel with you for requesting tracks.', 'DARK_RED');
-  
-      if (!player.queue.current) return replyInteractionEmbed(interaction, '', 'There is no music playing.', 'DARK_RED');
+    if (!player) return replyInteractionEmbed(interaction, '', 'Play a track before using this command.', 'DARK_RED');
 
-      const { title } = player.queue.current;
+    const { channel } = interaction.member.voice;
+    if (!channel) return replyInteractionEmbed(interaction, '', 'Join a voice channel first.', 'DARK_RED');
+    if (channel.id !== player.voiceChannel) return replyInteractionEmbed(interaction, '', 'I\'ve to be in the same voice channel with you for requesting tracks.', 'DARK_RED');
 
-      player.stop();
-      return replyInteractionEmbed(interaction, '', `${title} was skipped.`, 'DARK_GREEN');
+    if (!player.queue.current) return replyInteractionEmbed(interaction, '', 'There is no music playing.', 'DARK_RED');
+
+    const { title } = player.queue.current;
+
+    if (amount != undefined) 
+    {
+      if (player.queue.totalSize > amount)
+        return replyInteractionEmbed(interaction, '', `Queue isnt that Big ;).`, 'DARK_RED');
+      for (let i = 0; i <= amount; i++)
+        await player.play();
+      return replyInteractionEmbed(interaction, '', `Songs was skipped.`, 'DARK_GREEN');
+    }
+    else if (queue_number != undefined)
+    {
+      if (player.queue.size > queue_number)
+        return replyInteractionEmbed(interaction, '', `Queue isnt that Big ;).`, 'DARK_RED');
+      for (let i = 0; i <= queue_number; i++)
+        await player.play();
+      return replyInteractionEmbed(interaction, '', `Songs was skipped.`, 'DARK_GREEN');
+    }
+
+    player.play();
+    return replyInteractionEmbed(interaction, '', `${title} was skipped.`, 'DARK_GREEN');
   },
 };

From f3c1feeeaebd11598711ae537ecce40172968e10 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Thu, 3 Feb 2022 10:40:54 +0100
Subject: [PATCH 11/29] Added Grafana integration

---
 data/example.env                             |  5 +++
 src/events/generic/ready.js                  |  9 +++-
 src/events/generic/voiceStateUpdate.js       | 44 ++++++++++++++++++++
 src/events/music/playerCreate.js             |  8 ++++
 src/events/music/playerDestroy.js            |  8 ++++
 src/modules/channelModule/channelModule.js   | 12 ++++++
 src/modules/databaseModule/databaseModule.js | 41 +++++++++++++++++-
 7 files changed, 123 insertions(+), 4 deletions(-)
 create mode 100644 src/events/generic/voiceStateUpdate.js
 create mode 100644 src/events/music/playerCreate.js
 create mode 100644 src/events/music/playerDestroy.js

diff --git a/data/example.env b/data/example.env
index 995d2cc..8fc3cad 100644
--- a/data/example.env
+++ b/data/example.env
@@ -22,3 +22,8 @@ CLIENTSECRET=""
 
 # Better Uptime (Optional) see https://betteruptime.com
 URL=""
+
+# Grafana --> https://grafana.com/
+# If disabled, the database tables will still generate, however no data is being collected
+# If enabled, Golden tracks the amount current listeners and players and save them to the database for Grafana
+GRAFANA_ENABLED=false
diff --git a/src/events/generic/ready.js b/src/events/generic/ready.js
index 5101974..ebc114a 100644
--- a/src/events/generic/ready.js
+++ b/src/events/generic/ready.js
@@ -1,5 +1,5 @@
-const { resetChannel, channelEmbedExists } = require('../../modules/channelModule/channelModule');
-const { getAllGuilds } = require('../../modules/databaseModule/databaseModule');
+const { resetChannel, channelEmbedExists, countAllListeningMembers } = require('../../modules/channelModule/channelModule');
+const { getAllGuilds, setActiveListeners, setActivePlayers } = require('../../modules/databaseModule/databaseModule');
 const { setRandomActivities } = require('../../modules/activityModule/activityModule');
 const { Uptime } = require('better-uptime');
 const { createTables } = require('../../modules/databaseModule/databaseModule')
@@ -39,5 +39,10 @@ module.exports = {
                 time: 3,
                 time_type: 'minute', //millisecond, minute, hour, day, week
             });
+        
+        if (process.env.GRAFANA_ENABLED) {
+            await setActivePlayers(client.manager.players.size)
+            await setActiveListeners(await countAllListeningMembers(client))
+        }
     }
 };
diff --git a/src/events/generic/voiceStateUpdate.js b/src/events/generic/voiceStateUpdate.js
new file mode 100644
index 0000000..c53be96
--- /dev/null
+++ b/src/events/generic/voiceStateUpdate.js
@@ -0,0 +1,44 @@
+const { setActiveListeners } = require('../../modules/databaseModule/databaseModule')
+const { countAllListeningMembers } = require('../../modules/channelModule/channelModule')
+
+module.exports = {
+    name: 'voiceStateUpdate',
+    once: false,
+    async execute(oldUser, newUser, client) {
+        if (!process.env.GRAFANA_ENABLED) return;
+
+        if (newUser.member.user.bot) {
+            const player = await client.manager.get(newUser.guild.id);
+            if (player === undefined) return;
+            if (newUser.channelId != player.voiceChannel) return;
+
+            // E.g. user moved bot to another channel
+            await setActiveListeners(await countAllListeningMembers(client))
+
+        } else if (oldUser.channelId === null && newUser.channelId != null) {
+            const player = await client.manager.get(newUser.guild.id);
+            if (player === undefined) return;
+            if (newUser.channelId != player.voiceChannel) return;
+
+            // User joined bots channel
+            await setActiveListeners(await countAllListeningMembers(client))
+
+        } else if (oldUser.channelId != null && newUser.channelId === null) {
+            const player = await client.manager.get(oldUser.guild.id);
+            if (player === undefined) return;
+            if (oldUser.channelId != player.voiceChannel) return;
+
+            // User left bots channel
+            await setActiveListeners(await countAllListeningMembers(client))
+
+        } else if (oldUser.channelId != null && newUser.channelId != null) {
+            const player = await client.manager.get(newUser.guild.id);
+            if (player === undefined) return;
+            if (oldUser.channelId != player.voiceChannel && newUser.channelId != player.voiceChannel) return;
+
+            // User moved in or out of bots channel
+            await setActiveListeners(await countAllListeningMembers(client))
+
+        }
+    },
+};
diff --git a/src/events/music/playerCreate.js b/src/events/music/playerCreate.js
new file mode 100644
index 0000000..6c89317
--- /dev/null
+++ b/src/events/music/playerCreate.js
@@ -0,0 +1,8 @@
+const { setActivePlayers, setActiveListeners, guildExists } = require('../../modules/databaseModule/databaseModule');
+const { countAllListeningMembers } = require('../../modules/channelModule/channelModule')
+
+module.exports = async (client, player) => {
+    if (!process.env.GRAFANA_ENABLED) return;
+	await setActivePlayers(client.manager.players.size)
+    await setActiveListeners(await countAllListeningMembers(client))
+};
diff --git a/src/events/music/playerDestroy.js b/src/events/music/playerDestroy.js
new file mode 100644
index 0000000..5f76580
--- /dev/null
+++ b/src/events/music/playerDestroy.js
@@ -0,0 +1,8 @@
+const { setActivePlayers, setActiveListeners, guildExists } = require('../../modules/databaseModule/databaseModule');
+const { countAllListeningMembers } = require('../../modules/channelModule/channelModule')
+
+module.exports = async (client, player) => {
+    if (!process.env.GRAFANA_ENABLED) return;
+	await setActivePlayers(client.manager.players.size-1)
+    await setActiveListeners(await countAllListeningMembers(client))
+};
diff --git a/src/modules/channelModule/channelModule.js b/src/modules/channelModule/channelModule.js
index d39c88c..e264b29 100644
--- a/src/modules/channelModule/channelModule.js
+++ b/src/modules/channelModule/channelModule.js
@@ -370,4 +370,16 @@ module.exports = {
     const part = Math.floor((ms / duration) * 10);
     return '═'.repeat(part) + '🟢' + '═'.repeat(10 - part);
   },
+
+  countAllListeningMembers: async function (client) {
+    let members = 0;
+    for (const [guild, playerData] of client.manager.players.entries()) {
+      const cachedGuild = await client.guilds.cache.get(guild);
+      const channel = await cachedGuild.channels.cache.get(playerData.voiceChannel);
+      members += channel.members.size;
+
+      if (channel.members.has(client.user.id)) members--; // If Golden is already in the music channel: do not count him
+    }
+    return members;
+  }
 };
diff --git a/src/modules/databaseModule/databaseModule.js b/src/modules/databaseModule/databaseModule.js
index 595a598..7072ce1 100644
--- a/src/modules/databaseModule/databaseModule.js
+++ b/src/modules/databaseModule/databaseModule.js
@@ -29,7 +29,18 @@ module.exports = {
                                     musicChannelId VARCHAR(255),\
                                     musicChannelHeroId VARCHAR(255),\
                                     musicChannelEmbedId VARCHAR(255)\
-                                  );", [1, "mariadb"]);
+                                  );\
+                                  CREATE TABLE IF NOT EXISTS grafana(\
+                                    id VARCHAR(255) UNIQUE NOT NULL,\
+                                    value INT NOT NULL,\
+                                    lastUpdated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\
+                                    );\
+                                    INSERT IGNORE INTO grafana\
+                                    (id, value) VALUES ('activePlayers', 0)\
+                                  ;\
+                                  INSERT IGNORE INTO grafana\
+                                    (id, value) VALUES ('activeListeners', 0)\
+                                  ;", [1, "mariadb"]);
 
     } catch (err) {
       console.log(err)
@@ -181,6 +192,32 @@ module.exports = {
     } finally {
       if (conn) return conn.end();
     }
-  }
+  },
+
+  setActivePlayers: async function(amount) {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE grafana SET value = ${amount} WHERE id = 'activePlayers';`, [1, "mariadb"]);
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
+  },
+  
+  setActiveListeners: async function(amount) {
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE grafana SET value = ${amount} WHERE id = 'activeListeners';`, [1, "mariadb"]);
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
 
+  }
 }
\ No newline at end of file

From 4446e525b665df738506e5b82b59426174dcb45d Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Thu, 10 Feb 2022 14:15:45 +0100
Subject: [PATCH 12/29] Combined Grafana with global statistics Renamed Grafana
 to analytics Fixed users count Added timestamps to console messages Renamed
 .env to config.env Renamed example.env to template.env Restructured
 template.env Small fixes for MariaDB Added parse check for config.env Merged
 config.json into config.env Spotify is now an optional module Better Uptime
 is now configurable inside config.env Updated .gitignore Added global command
 registration as an option inside config.env

---
 .gitignore                                   |  3 +-
 data/config.json                             | 29 -----------
 data/example.env                             | 29 -----------
 data/template.env                            | 47 ++++++++++++++++++
 package.json                                 |  1 +
 src/commands/information/status.js           | 10 ++--
 src/commands/music/setup.js                  |  5 +-
 src/events/generic/interactionCreate.js      |  5 +-
 src/events/generic/ready.js                  | 29 ++++++++---
 src/events/generic/voiceStateUpdate.js       |  2 +-
 src/events/music/playerCreate.js             |  2 +-
 src/events/music/playerDestroy.js            |  2 +-
 src/golden.js                                | 35 +++++++------
 src/modules/activityModule/activityModule.js | 33 ++++++++-----
 src/modules/channelModule/channelModule.js   | 27 ++++------
 src/modules/databaseModule/databaseModule.js | 47 +++++++++---------
 src/modules/handlerModule/handlerModule.js   | 14 +++---
 yarn.lock                                    | 52 ++++++++++++++++++++
 18 files changed, 217 insertions(+), 155 deletions(-)
 delete mode 100644 data/config.json
 delete mode 100644 data/example.env
 create mode 100644 data/template.env

diff --git a/.gitignore b/.gitignore
index fc5829a..45a863c 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,3 @@
 .DS_Store
 /node_modules
-/data/.env
-/data/data.db
\ No newline at end of file
+/data/config.env
diff --git a/data/config.json b/data/config.json
deleted file mode 100644
index e997b66..0000000
--- a/data/config.json
+++ /dev/null
@@ -1,29 +0,0 @@
-{
-    "channelHeader": "https://cdn.discordapp.com/attachments/911271717492621343/914553180883406898/bg2v3.png",
-    "channelEmbedThumbnail": "https://cdn.discordapp.com/attachments/911271717492621343/912002185267646544/bg4.png",
-    "embedNoSongPlayingTitle": "<:musicnote:930887306045435934> | No song is being played",
-    "embedDescription": "[Bot Invite](https://golden.invite.spasten.studio/) | [Dashboard](https://golden.spasten.studio) | [Commands](https://golden.spasten.studio) | [Support](https://discord.gg/PX28nyVgdP)",
-    "embedEmptyQueue": "\n__**Queue:**__\nJoin a Voice Channel and add a Song or a Playlist",
-    "activities": [
-        {
-            "name": "/guildCacheSize/ Servers",
-            "type": "LISTENING"
-          },
-          {
-            "name": "with /userCacheSize/ Members",
-            "type": "PLAYING"
-          },
-          {
-            "name": "/goldenChannelCount/ music channels",
-            "type": "LISTENING"
-          },
-          {
-            "name": "@Botis‽#0666",
-            "type": "WATCHING"
-          },
-          {
-            "name": "@Raved#8329",
-            "type": "PLAYING"
-          }
-    ]
-}
diff --git a/data/example.env b/data/example.env
deleted file mode 100644
index 8fc3cad..0000000
--- a/data/example.env
+++ /dev/null
@@ -1,29 +0,0 @@
-# Discord
-TOKEN= "YOUR_BOT_TOKEN"
-APPID= "YOUR_APPLICATION_ID"
-GUILDID= "THE_GUILD_ID(FOR_DEVELOPMENT)"
-
-# Database
-DB_HOST="localhost"
-DB_PORT=3306
-DB_USERNAME=""
-DB_DATABASE=""
-DB_PASSWORD=""
-
-# LavaLink
-LL_HOST=""
-LL_PORT=2333
-LL_PASSWORD=""
-LL_SECURE=false
-
-# Spotify --> https://developer.spotify.com/dashboard/
-CLIENTID=""
-CLIENTSECRET=""
-
-# Better Uptime (Optional) see https://betteruptime.com
-URL=""
-
-# Grafana --> https://grafana.com/
-# If disabled, the database tables will still generate, however no data is being collected
-# If enabled, Golden tracks the amount current listeners and players and save them to the database for Grafana
-GRAFANA_ENABLED=false
diff --git a/data/template.env b/data/template.env
new file mode 100644
index 0000000..3341e29
--- /dev/null
+++ b/data/template.env
@@ -0,0 +1,47 @@
+# .env template for Golden 4.3
+
+# Start by copying this file and renaming it to config.env
+# The template.env file might change on updates
+
+# Golden
+GOLDEN_HEADER="https://cdn.discordapp.com/attachments/911271717492621343/914553180883406898/bg2v3.png"
+GOLDEN_EMBED_THUMBNAIL="https://cdn.discordapp.com/attachments/911271717492621343/912002185267646544/bg4.png"
+GOLDEN_EMBED_TITLE="<:musicnote:930887306045435934> | No song is being played"
+GOLDEN_EMBED_DESCRIPTION="[Bot Invite](https://golden.invite.spasten.studio/) | [Dashboard](https://golden.spasten.studio) | [Commands](https://golden.spasten.studio) | [Support](https://discord.gg/PX28nyVgdP)"
+GOLDEN_EMBED_MESSAGE="\n__**Queue:**__\nJoin a Voice Channel and add a Song or a Playlist"
+
+# Discord API see https://discord.com/developers/
+DISCORD_TOKEN= ""
+DISCORD_APPID= ""
+
+DISCORD_GLOBAL_COMMANDS=true
+DISCORD_GUILDID= ""
+
+# MySQL / MariaDB
+DB_HOST="localhost"
+DB_PORT=3306
+DB_USERNAME=""
+DB_DATABASE=""
+DB_PASSWORD=""
+
+# LavaLink see https://github.com/freyacodes/Lavalink
+LAVALINK_HOST="localhost"
+LAVALINK_PORT=2333
+LAVALINK_PASSWORD=""
+LAVALINK_SSL=false
+
+# Spotify see https://developer.spotify.com/dashboard/
+SPOTIFY_ENABLED=false
+SPOTIFY_CLIENTID=""
+SPOTIFY_CLIENTSECRET=""
+
+# Better Uptime see https://betteruptime.com/
+BETTERUPTIME_ENABLED=false
+BETTERUPTIME_HEARTBEAT_URL=""
+BETTERUPTIME_TIME=1
+BETTERUPTIME_TIME_TYPE="minute"
+
+# Analytics
+# Golden tracks the amount of current listeners and players and save them to the database
+# You might use a service like https://grafana.com/ to display the data inside an dashboard
+ANALYTICS_ENABLED=false
diff --git a/package.json b/package.json
index 08566fa..37373d5 100644
--- a/package.json
+++ b/package.json
@@ -13,6 +13,7 @@
     "@discordjs/rest": "^0.1.0-canary.0",
     "better-uptime": "^1.1.4",
     "check-links": "^1.1.8",
+    "console-stamp": "^3.0.3",
     "discord-api-types": "^0.25.2",
     "discord-together": "^1.3.25",
     "discord.js": "^13.3.1",
diff --git a/src/commands/information/status.js b/src/commands/information/status.js
index 4611833..ffa9960 100644
--- a/src/commands/information/status.js
+++ b/src/commands/information/status.js
@@ -1,6 +1,6 @@
 const { SlashCommandBuilder } = require("@discordjs/builders");
 const { MessageEmbed } = require("discord.js");
-const { getGlobal } = require("../../modules/databaseModule/databaseModule");
+const { getChannelsCreated } = require("../../modules/databaseModule/databaseModule");
 
 module.exports = {
   data: new SlashCommandBuilder()
@@ -26,8 +26,8 @@ module.exports = {
     let seconds = Math.floor(totalSeconds % 60);
 
     const usage = process.cpuUsage();
-    const global = await getGlobal();
-
+    const channelsCreated = await getChannelsCreated();
+    
     interaction.editReply({
       embeds: [
         embed
@@ -84,12 +84,12 @@ module.exports = {
             },
             {
               name: "Music channels",
-              value: `${global.value}`,
+              value: `${channelsCreated.value}`,
               inline: true,
             },
             {
               name: "Users",
-              value: `${client.users.cache.size}`,
+              value: `${client.guilds.cache.map((g) => g.memberCount).reduce((a, c) => a + c)}`,
               inline: true,
             }
           )
diff --git a/src/commands/music/setup.js b/src/commands/music/setup.js
index 7724ca2..4172e53 100644
--- a/src/commands/music/setup.js
+++ b/src/commands/music/setup.js
@@ -1,5 +1,5 @@
 const { SlashCommandBuilder } = require("@discordjs/builders");
-const { setGuildChannel, setGuildChannelEmbed, setGuildChannelHero, increaseChannelCount } = require("../../modules/databaseModule/databaseModule");
+const { setGuildChannel, setGuildChannelEmbed, setGuildChannelHero, increaseChannelsCreated } = require("../../modules/databaseModule/databaseModule");
 const {
   createChannel,
   channelExists,
@@ -61,7 +61,8 @@ module.exports = {
       setEmbed(guild, player);
     });
 
-    increaseChannelCount();
+    if (process.env.ANALYTICS_ENABLED)
+      increaseChannelsCreated();
     return interaction.reply({
       embeds: [createEmbed('Channel creation successful', `I\'ve created my new channel successfully ${channel}\nJust send any track url or name into the channel and I'll do the rest.`, 'DARK_GREEN', 'https://cdn.discordapp.com/attachments/922836431045525525/922846375312498698/pop.png')],
       ephemeral: true
diff --git a/src/events/generic/interactionCreate.js b/src/events/generic/interactionCreate.js
index 795f49f..fcd96f9 100644
--- a/src/events/generic/interactionCreate.js
+++ b/src/events/generic/interactionCreate.js
@@ -3,7 +3,7 @@ const {
   setGuildChannel,
   setGuildChannelEmbed,
   setGuildChannelHero,
-  increaseChannelCount
+  increaseChannelsCreated
 } = require("../../modules/databaseModule/databaseModule");
 const {
   createChannel,
@@ -60,7 +60,8 @@ module.exports = {
             setEmbed(guild, player);
           });
 
-          increaseChannelCount();
+          if (process.env.ANALYTICS_ENABLED)
+            increaseChannelsCreated();
           return interaction.update({
             embeds: [createEmbed('Channel creation successful', `I\'ve created my new channel successfully ${channel}\nJust send any track url or name into the channel and I'll do the rest.`, 'DARK_GREEN', 'https://cdn.discordapp.com/attachments/922836431045525525/922846375312498698/pop.png')],
             components: []
diff --git a/src/events/generic/ready.js b/src/events/generic/ready.js
index ebc114a..bbb10fc 100644
--- a/src/events/generic/ready.js
+++ b/src/events/generic/ready.js
@@ -1,5 +1,5 @@
 const { resetChannel, channelEmbedExists, countAllListeningMembers } = require('../../modules/channelModule/channelModule');
-const { getAllGuilds, setActiveListeners, setActivePlayers } = require('../../modules/databaseModule/databaseModule');
+const { getAllGuilds, setActiveListeners, setActivePlayers, closeConnection } = require('../../modules/databaseModule/databaseModule');
 const { setRandomActivities } = require('../../modules/activityModule/activityModule');
 const { Uptime } = require('better-uptime');
 const { createTables } = require('../../modules/databaseModule/databaseModule')
@@ -20,7 +20,18 @@ module.exports = {
         );
         console.log('╰' + '─'.repeat(65) + '╯');
 
-        await createTables(); // create tables if not exists
+        await createTables().catch(err => {
+            console.log(err);
+            process.exit()
+        }); // create tables if not exists
+
+        process.on('SIGINT', function() {
+            process.exit()
+        });
+        process.on('exit', function() {
+            closeConnection().catch(err => console.log(err))
+            process.exit()
+        });
 
         const registeredGuilds = await getAllGuilds();
 
@@ -33,16 +44,20 @@ module.exports = {
                 resetChannel(cachedGuild);
         }
 
-        if (process.env.URL.includes('http'))
+        if (process.env.BETTERUPTIME_ENABLED === 'true')
             new Uptime({
-                url: process.env.URL,
-                time: 3,
-                time_type: 'minute', //millisecond, minute, hour, day, week
+                url: process.env.BETTERUPTIME_URL,
+                time: process.env.BETTERUPTIME_TIME,
+                time_type: process.env.BETTERUPTIME_TIME_TYPE, //millisecond, minute, hour, day, week
             });
         
-        if (process.env.GRAFANA_ENABLED) {
+        if (process.env.ANALYTICS_ENABLED) {
             await setActivePlayers(client.manager.players.size)
             await setActiveListeners(await countAllListeningMembers(client))
         }
+
+        require('console-stamp')(console, {
+            format: ':date(dd.mm HH:MM:ss)'
+        });
     }
 };
diff --git a/src/events/generic/voiceStateUpdate.js b/src/events/generic/voiceStateUpdate.js
index c53be96..51bb0c3 100644
--- a/src/events/generic/voiceStateUpdate.js
+++ b/src/events/generic/voiceStateUpdate.js
@@ -5,7 +5,7 @@ module.exports = {
     name: 'voiceStateUpdate',
     once: false,
     async execute(oldUser, newUser, client) {
-        if (!process.env.GRAFANA_ENABLED) return;
+        if (!process.env.ANALYTICS_ENABLED) return;
 
         if (newUser.member.user.bot) {
             const player = await client.manager.get(newUser.guild.id);
diff --git a/src/events/music/playerCreate.js b/src/events/music/playerCreate.js
index 6c89317..1a4e468 100644
--- a/src/events/music/playerCreate.js
+++ b/src/events/music/playerCreate.js
@@ -2,7 +2,7 @@ const { setActivePlayers, setActiveListeners, guildExists } = require('../../mod
 const { countAllListeningMembers } = require('../../modules/channelModule/channelModule')
 
 module.exports = async (client, player) => {
-    if (!process.env.GRAFANA_ENABLED) return;
+    if (!process.env.ANALYTICS_ENABLED) return;
 	await setActivePlayers(client.manager.players.size)
     await setActiveListeners(await countAllListeningMembers(client))
 };
diff --git a/src/events/music/playerDestroy.js b/src/events/music/playerDestroy.js
index 5f76580..037ceda 100644
--- a/src/events/music/playerDestroy.js
+++ b/src/events/music/playerDestroy.js
@@ -2,7 +2,7 @@ const { setActivePlayers, setActiveListeners, guildExists } = require('../../mod
 const { countAllListeningMembers } = require('../../modules/channelModule/channelModule')
 
 module.exports = async (client, player) => {
-    if (!process.env.GRAFANA_ENABLED) return;
+    if (!process.env.ANALYTICS_ENABLED) return;
 	await setActivePlayers(client.manager.players.size-1)
     await setActiveListeners(await countAllListeningMembers(client))
 };
diff --git a/src/golden.js b/src/golden.js
index 9e83998..b3d5f94 100644
--- a/src/golden.js
+++ b/src/golden.js
@@ -1,4 +1,4 @@
-require("dotenv").config({ path: "./data/.env" });
+const env = require("dotenv").config({ path: "./data/config.env" });
 
 const Spotify = require("erela.js-spotify");
 const { Client, Intents } = require("discord.js");
@@ -11,8 +11,10 @@ const {
   registerMusicEvents
 } = require("./modules/handlerModule/handlerModule");
 
+if (!env.parsed)
+  return console.log('Fatal: config.env file missing or unreadable\nSetup instructions at https://github.com/spastenstudio/Golden')
+
 const client = new Client({
-  fetchAllMembers: true,
   shards: "auto",
   intents: [
     Intents.FLAGS.GUILDS,
@@ -22,25 +24,26 @@ const client = new Client({
   ],
 });
 
+const plugins = []
+if (process.env.SPOTIFY_ENABLED === 'true')
+  plugins.push(new Spotify({
+    clientID: process.env.SPOTIFY_CLIENTID,
+    clientSecret: process.env.SPOTIFY_CLIENTSECRET,
+  }))
+
 client.manager = new Manager({
   nodes: [
     {
-      host: process.env.LL_HOST,
-      port: Number(process.env.LL_PORT),
-      password: process.env.LL_PASSWORD,
+      host: process.env.LAVALINK_HOST,
+      port: Number(process.env.LAVALINK_PORT),
+      password: process.env.LAVALINK_PASSWORD,
       retryDelay: 5000,
-      secure: process.env.LL_SECURE === "true" ? true : false
+      secure: process.env.LAVALINK_SSL === "true" ? true : false
     },
   ],
-  plugins: [
-    new Spotify({
-      clientID: process.env.CLIENTID,
-      clientSecret: process.env.CLIENTSECRET,
-    }),
-  ],
+  plugins,
   autoPlay: true,
-  send: (id, payload) =>
-  {
+  send: (id, payload) => {
     const guild = client.guilds.cache.get(id);
     if (guild) guild.shard.send(payload);
   },
@@ -50,6 +53,6 @@ client.discordTogether = new DiscordTogether(client);
 
 registerMusicEvents(client);
 registerGenericEvents(client);
-registerCommands(client, false);
+registerCommands(client);
 
-client.login(process.env.TOKEN);
+client.login(process.env.DISCORD_TOKEN);
diff --git a/src/modules/activityModule/activityModule.js b/src/modules/activityModule/activityModule.js
index ee00dfd..0039217 100644
--- a/src/modules/activityModule/activityModule.js
+++ b/src/modules/activityModule/activityModule.js
@@ -1,33 +1,40 @@
-const activities = require("../../../data/config.json").activities;
-const { getGlobal } = require("../databaseModule/databaseModule");
+const { getChannelsCreated } = require("../databaseModule/databaseModule");
+
+const activities = [
+      {
+          "name": "/guildCacheSize/ Servers",
+          "type": "LISTENING"
+        },
+        {
+          "name": "with /userCacheSize/ Members",
+          "type": "PLAYING"
+        },
+        {
+          "name": "/goldenChannelsCreated/ music channels",
+          "type": "LISTENING"
+        }
+  ]
 
 module.exports = {
   setRandomActivities: async function (client)
   {
     setInterval(async () =>
     {
-      const global = await getGlobal();
+      const channelsCreated = await getChannelsCreated();
       const activity =
         activities[Math.floor(Math.random() * activities.length)];
 
-      client.guilds.fetch();
-
-      client.guilds.cache.forEach(guild =>
-      {
-        guild.members.fetch();
-      });
-
       activity.name = activity.name.replace(
         "/guildCacheSize/",
         client.guilds.cache.size
       );
       activity.name = activity.name.replace(
         "/userCacheSize/",
-        client.users.cache.size
+        client.guilds.cache.map((g) => g.memberCount).reduce((a, c) => a + c)
       );
       activity.name = activity.name.replace(
-        "/goldenChannelCount/",
-        global.value
+        "/goldenChannelsCreated/",
+        channelsCreated.value
       );
 
       client.user.setActivity(`${activity.name}`, {
diff --git a/src/modules/channelModule/channelModule.js b/src/modules/channelModule/channelModule.js
index e264b29..3f49d51 100644
--- a/src/modules/channelModule/channelModule.js
+++ b/src/modules/channelModule/channelModule.js
@@ -4,13 +4,6 @@ const {
   getGuildChannelEmbed,
 } = require('../databaseModule/databaseModule');
 
-const {
-  channelHeader,
-  channelEmbedThumbnail,
-  embedNoSongPlayingTitle,
-  embedDescription,
-  embedEmptyQueue,
-} = require('../../../data/config.json');
 const { createEmbed } = require('../embedModule/embedModule');
 
 const { MessageActionRow, MessageEmbed, MessageButton } = require('discord.js');
@@ -39,7 +32,7 @@ module.exports = {
     const channelId = await getGuildChannel(guildId);
     const channel = await guild.channels.cache.get(channelId);
 
-    const channelHero = await channel.send(channelHeader);
+    const channelHero = await channel.send(process.env.GOLDEN_HEADER);
 
     const channelControlComponent = new MessageActionRow()
       .addComponents(
@@ -76,14 +69,14 @@ module.exports = {
 
     const channelEmbed = new MessageEmbed()
       .setColor('DARK_BUT_NOT_BLACK')
-      .setTitle(embedNoSongPlayingTitle)
-      .setDescription(embedDescription)
-      .setImage(channelEmbedThumbnail)
+      .setTitle(process.env.GOLDEN_EMBED_TITLE)
+      .setDescription(process.env.GOLDEN_EMBED_DESCRIPTION)
+      .setImage(process.env.GOLDEN_EMBED_THUMBNAIL)
       .setFooter({ text: `0 songs in queue | Volume: 100%  | Loop: Disabled` });
 
     const channelEmbedMessage = await channel
       .send({
-        content: embedEmptyQueue,
+        content: process.env.GOLDEN_EMBED_MESSAGE,
         embeds: [channelEmbed],
         components: [channelControlComponent],
       })
@@ -184,7 +177,7 @@ module.exports = {
       if (player.queue.current.thumbnail === null)
       {
         // if there's no thumbnail (e.g. SoundCloud or radio link)
-        channelEmbed.embeds[0].image.url = channelEmbedThumbnail;
+        channelEmbed.embeds[0].image.url = process.env.GOLDEN_EMBED_THUMBNAIL;
       } else
       {
         let trackThumbnail = await player.queue.current.displayThumbnail("maxresdefault");
@@ -240,7 +233,7 @@ module.exports = {
           ],
         }); // e.g. embed was removed from message manually
 
-      channelEmbed.embeds[0].title = embedNoSongPlayingTitle;
+      channelEmbed.embeds[0].title = process.env.GOLDEN_EMBED_TITLE;
 
       const currComponents = channelEmbed.components[0];
       for (const button of currComponents.components)
@@ -252,13 +245,13 @@ module.exports = {
         }
       }
 
-      channelEmbed.embeds[0].image = { url: channelEmbedThumbnail };
+      channelEmbed.embeds[0].image = { url: process.env.GOLDEN_EMBED_THUMBNAIL };
       channelEmbed.embeds[0].footer = {
         text: `0 songs in queue | Volume: ${volume}% | Loop: Disabled`,
       };
 
       channelEmbed.edit({
-        content: embedEmptyQueue,
+        content: process.env.GOLDEN_EMBED_MESSAGE,
         embeds: [new MessageEmbed(channelEmbed.embeds[0])],
         components: [new MessageActionRow(currComponents)],
       });
@@ -335,7 +328,7 @@ module.exports = {
 
   generateQueue: function (queue)
   {
-    if (queue.length < 1) return embedEmptyQueue;
+    if (queue.length < 1) return process.env.GOLDEN_EMBED_MESSAGE;
 
     let contentLength = 0;
     const formattedQueueArray = [];
diff --git a/src/modules/databaseModule/databaseModule.js b/src/modules/databaseModule/databaseModule.js
index 7072ce1..8840fb8 100644
--- a/src/modules/databaseModule/databaseModule.js
+++ b/src/modules/databaseModule/databaseModule.js
@@ -1,6 +1,7 @@
 const mariadb = require('mariadb');
 const pool = mariadb.createPool({
   host: process.env.DB_HOST,
+  port: process.env.DB_PORT,
   user: process.env.DB_USERNAME,
   password: process.env.DB_PASSWORD,
   database: process.env.DB_DATABASE,
@@ -14,14 +15,11 @@ module.exports = {
     let conn;
     try {
       conn = await pool.getConnection();
-      // TODO: change global table.., check connection in golden.js, maybe change setup icon buttons to yellow?
-      await conn.query("CREATE TABLE IF NOT EXISTS global(\
+      await conn.query("CREATE TABLE IF NOT EXISTS analytics(\
                                     id VARCHAR(255) UNIQUE NOT NULL,\
-                                    value INT NOT NULL\
-                                  );\
-                                  INSERT IGNORE INTO global\
-                                    (id, value) VALUES ('channelCount', 0)\
-                                  ;\
+                                    value INT NOT NULL,\
+                                    lastUpdated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\
+                                    );\
                                   CREATE TABLE IF NOT EXISTS guilds(\
                                     id INT UNSIGNED AUTO_INCREMENT PRIMARY KEY,\
                                     guildId VARCHAR(255) UNIQUE NOT NULL,\
@@ -30,20 +28,17 @@ module.exports = {
                                     musicChannelHeroId VARCHAR(255),\
                                     musicChannelEmbedId VARCHAR(255)\
                                   );\
-                                  CREATE TABLE IF NOT EXISTS grafana(\
-                                    id VARCHAR(255) UNIQUE NOT NULL,\
-                                    value INT NOT NULL,\
-                                    lastUpdated TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP\
-                                    );\
-                                    INSERT IGNORE INTO grafana\
+                                  INSERT IGNORE INTO analytics\
+                                    (id, value) VALUES ('channelsCreated', 0)\
+                                  ;\
+                                  INSERT IGNORE INTO analytics\
                                     (id, value) VALUES ('activePlayers', 0)\
                                   ;\
-                                  INSERT IGNORE INTO grafana\
+                                  INSERT IGNORE INTO analytics\
                                     (id, value) VALUES ('activeListeners', 0)\
                                   ;", [1, "mariadb"]);
 
     } catch (err) {
-      console.log(err)
       throw err;
     } finally {
       if (conn) return conn.end();
@@ -55,7 +50,6 @@ module.exports = {
   },
 
   addGuild: async function (guildId, guildName) {
-    console.log(guildName)
     if (guildName === undefined) guildName = "Unknown";
     let conn;
     try {
@@ -104,6 +98,7 @@ module.exports = {
 
   getGuildChannel: async function (guildId) {
     const guild = await module.exports.getGuild(guildId);
+    if (guild === undefined) return null; // return null if guild doesnt' exist
     return guild.musicChannelId;
   },
 
@@ -166,11 +161,11 @@ module.exports = {
     }
   },
 
-  getGlobal: async function () {
+  getChannelsCreated: async function () {
     let conn;
     try {
       conn = await pool.getConnection();
-      const res = await conn.query(`SELECT * FROM global;`, [1, "mariadb"]);
+      const res = await conn.query(`SELECT * FROM analytics WHERE id = 'channelsCreated';`, [1, "mariadb"]);
 
       if (conn) conn.end();
       return res[0]
@@ -181,11 +176,11 @@ module.exports = {
     }
   },
 
-  increaseChannelCount: async function () {
+  increaseChannelsCreated: async function () {
     let conn;
     try {
       conn = await pool.getConnection();
-      await conn.query(`UPDATE global SET value = value + 1 WHERE id = 'channelCount';`, [1, "mariadb"]);
+      await conn.query(`UPDATE analytics SET value = value + 1 WHERE id = 'channelsCreated';`, [1, "mariadb"]);
     } catch (err) {
       console.log(err)
       throw err;
@@ -198,7 +193,7 @@ module.exports = {
     let conn;
     try {
       conn = await pool.getConnection();
-      await conn.query(`UPDATE grafana SET value = ${amount} WHERE id = 'activePlayers';`, [1, "mariadb"]);
+      await conn.query(`UPDATE analytics SET value = ${amount} WHERE id = 'activePlayers';`, [1, "mariadb"]);
     } catch (err) {
       console.log(err)
       throw err;
@@ -211,13 +206,21 @@ module.exports = {
     let conn;
     try {
       conn = await pool.getConnection();
-      await conn.query(`UPDATE grafana SET value = ${amount} WHERE id = 'activeListeners';`, [1, "mariadb"]);
+      await conn.query(`UPDATE analytics SET value = ${amount} WHERE id = 'activeListeners';`, [1, "mariadb"]);
     } catch (err) {
       console.log(err)
       throw err;
     } finally {
       if (conn) return conn.end();
     }
+  },
 
+  closeConnection: async function() {
+    try {
+      console.log('Closing database connection...')
+      await pool.end();
+    } catch (err) {
+      throw err;
+    }
   }
 }
\ No newline at end of file
diff --git a/src/modules/handlerModule/handlerModule.js b/src/modules/handlerModule/handlerModule.js
index c150593..3ad35d2 100644
--- a/src/modules/handlerModule/handlerModule.js
+++ b/src/modules/handlerModule/handlerModule.js
@@ -43,10 +43,8 @@ module.exports = {
     }
   },
 
-  registerCommands: function (client, global)
+  registerCommands: function (client)
   {
-    // global parameter => register slash commands globally
-
     const commands = [];
     client.commands = new Collection();
 
@@ -80,7 +78,7 @@ module.exports = {
 
     // Deploy commands
 
-    const rest = new REST({ version: "9" }).setToken(process.env.TOKEN);
+    const rest = new REST({ version: "9" }).setToken(process.env.DISCORD_TOKEN);
 
     (async () =>
     {
@@ -103,12 +101,12 @@ module.exports = {
 
       try
       {
-        if (!global)
+        if (!process.env.DISCORD_GLOBAL_COMMANDS)
         {
           await rest.put(
             Routes.applicationGuildCommands(
-              process.env.APPID,
-              process.env.GUILDID
+              process.env.DISCORD_APPID,
+              process.env.DISCORD_GUILDID
             ),
             {
               body: commands,
@@ -116,7 +114,7 @@ module.exports = {
           );
         } else
         {
-          await rest.put(Routes.applicationCommands(process.env.APPID), {
+          await rest.put(Routes.applicationCommands(process.env.DISCORD_APPID), {
             body: commands,
           });
         }
diff --git a/yarn.lock b/yarn.lock
index 61530df..7fba565 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -122,6 +122,13 @@ add-zero@^1.0.0:
   resolved "https://registry.yarnpkg.com/add-zero/-/add-zero-1.0.0.tgz#88e221696717f66db467672f3f9aa004de9f1a2c"
   integrity sha1-iOIhaWcX9m20Z2cvP5qgBN6fGiw=
 
+ansi-styles@^4.1.0:
+  version "4.3.0"
+  resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937"
+  integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==
+  dependencies:
+    color-convert "^2.0.1"
+
 asynckit@^0.4.0:
   version "0.4.0"
   resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
@@ -155,6 +162,14 @@ cacheable-request@^6.0.0:
     normalize-url "^4.1.0"
     responselike "^1.0.2"
 
+chalk@^4.1.1:
+  version "4.1.2"
+  resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01"
+  integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==
+  dependencies:
+    ansi-styles "^4.1.0"
+    supports-color "^7.1.0"
+
 check-links@^1.1.8:
   version "1.1.8"
   resolved "https://registry.yarnpkg.com/check-links/-/check-links-1.1.8.tgz#842184178c85d9c2ab119175bcc2672681bc88a4"
@@ -172,6 +187,18 @@ clone-response@^1.0.2:
   dependencies:
     mimic-response "^1.0.0"
 
+color-convert@^2.0.1:
+  version "2.0.1"
+  resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3"
+  integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==
+  dependencies:
+    color-name "~1.1.4"
+
+color-name@~1.1.4:
+  version "1.1.4"
+  resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2"
+  integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
+
 combined-stream@^1.0.8:
   version "1.0.8"
   resolved "https://registry.yarnpkg.com/combined-stream/-/combined-stream-1.0.8.tgz#c3d45a8b34fd730631a110a8a2520682b31d5a7f"
@@ -179,6 +206,19 @@ combined-stream@^1.0.8:
   dependencies:
     delayed-stream "~1.0.0"
 
+console-stamp@^3.0.3:
+  version "3.0.3"
+  resolved "https://registry.yarnpkg.com/console-stamp/-/console-stamp-3.0.3.tgz#a7a47427ffab893c20d30407199bc4b40346a7ba"
+  integrity sha512-6ltMcMEVDHb1bqb+qaVfCX7Vf3vEkfZEeKyReG1ny45Rv6YJynCcdv94j7whNVfxj/4/3Ji/QBHY6p4JI51Ucw==
+  dependencies:
+    chalk "^4.1.1"
+    dateformat "^4.5.1"
+
+dateformat@^4.5.1:
+  version "4.6.3"
+  resolved "https://registry.yarnpkg.com/dateformat/-/dateformat-4.6.3.tgz#556fa6497e5217fedb78821424f8a1c22fa3f4b5"
+  integrity sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==
+
 decompress-response@^3.3.0:
   version "3.3.0"
   resolved "https://registry.yarnpkg.com/decompress-response/-/decompress-response-3.3.0.tgz#80a4dd323748384bfa248083622aedec982adff3"
@@ -354,6 +394,11 @@ got@^9.6.0:
     to-readable-stream "^1.0.0"
     url-parse-lax "^3.0.0"
 
+has-flag@^4.0.0:
+  version "4.0.0"
+  resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b"
+  integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==
+
 http-cache-semantics@^4.0.0:
   version "4.1.0"
   resolved "https://registry.yarnpkg.com/http-cache-semantics/-/http-cache-semantics-4.1.0.tgz#49e91c5cbf36c9b94bcfcd71c23d5249ec74e390"
@@ -572,6 +617,13 @@ semver-compare@^1.0.0:
   resolved "https://registry.yarnpkg.com/semver-compare/-/semver-compare-1.0.0.tgz#0dee216a1c941ab37e9efb1788f6afc5ff5537fc"
   integrity sha1-De4hahyUGrN+nvsXiPavxf9VN/w=
 
+supports-color@^7.1.0:
+  version "7.2.0"
+  resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da"
+  integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==
+  dependencies:
+    has-flag "^4.0.0"
+
 to-readable-stream@^1.0.0:
   version "1.0.0"
   resolved "https://registry.yarnpkg.com/to-readable-stream/-/to-readable-stream-1.0.0.tgz#ce0aa0c2f3df6adf852efb404a783e77c0475771"

From 4f56405d2127f946076e1aa2c9fb93a59eefa04a Mon Sep 17 00:00:00 2001
From: Botis <barnekiel@gmail.com>
Date: Sun, 13 Feb 2022 13:36:21 +0100
Subject: [PATCH 13/29] Added Spacing between Emoji and Queue

---
 src/commands/music/queue.js | 242 ++++++++++++++++++------------------
 1 file changed, 119 insertions(+), 123 deletions(-)

diff --git a/src/commands/music/queue.js b/src/commands/music/queue.js
index eafc1b9..f74f34f 100644
--- a/src/commands/music/queue.js
+++ b/src/commands/music/queue.js
@@ -1,130 +1,126 @@
 const { MessageActionRow, MessageEmbed, MessageButton } = require('discord.js');
 const { SlashCommandBuilder } = require('@discordjs/builders');
 const {
-  replyInteractionEmbed,
+	replyInteractionEmbed,
 } = require('../../modules/channelModule/channelModule');
 
 module.exports = {
-  data: new SlashCommandBuilder().setName('queue').setDescription('View queue'),
-
-  async execute(interaction, client)
-  {
-    let page = 0;
-
-    const player = interaction.client.manager.get(interaction.guild.id);
-    if (!player)
-      return replyInteractionEmbed(
-        interaction,
-        'ERROR',
-        'Please request a Song before using this Command.',
-        'DARK_RED'
-      );
-
-    const queue = player.queue;
-
-    await interaction.reply({
-      embeds: [this.QueSetEmbed(queue, interaction.guild.id, page)],
-      components: [this.QueSetButtons(queue, interaction.guild.id, page)],
-      ephemeral: true,
-    });
-
-    /** ++ Button Collector ++ */
-    const filter = (button) =>
-      (button.customId === 'quePrevious' || button.customId === 'queNext') &&
-      button.user.id === interaction.user.id &&
-      interaction.id === button.message.interaction.id;
-
-    const collector = interaction.channel.createMessageComponentCollector({
-      filter,
-    });
-    collector.on('collect', async (button) =>
-    {
-      switch (button.customId)
-      {
-        case 'quePrevious':
-          await page--;
-          await button.update({
-            embeds: [this.QueSetEmbed(queue, interaction.guild.id, page)],
-            components: [this.QueSetButtons(queue, interaction.guild.id, page)],
-          });
-          break;
-
-        case 'queNext':
-          await page++;
-          await button.update({
-            embeds: [this.QueSetEmbed(queue, interaction.guild.id, page)],
-            components: [this.QueSetButtons(queue, interaction.guild.id, page)],
-          });
-          break;
-      }
-    });
-    /** -- Button Collector -- */
-  },
-
-  QueSetEmbed: function (queue, guildId, page)
-  {
-    const embed = new MessageEmbed()
-      .setTitle('**<:playlistmusic:930887305697325148>|Queue**')
-      .setTimestamp()
-      .setColor('DARK_GREEN');
-
-    if (page <= 0) page = 0;
-    const pageStart = 10 * page;
-    const pageEnd = pageStart + 10;
-
-    let tracks = `\`Now Playing.\` ** | [${queue.current.title} by ${queue.current.author}](${queue.current.uri})**`;
-
-    queue.slice(pageStart, pageEnd).map((track, i) =>
-    {
-      let pos = i + pageStart + 1;
-      return (tracks += `\n\`${pos}.\` ** | [${track.title} by ${track.author}](${track.uri})**`);
-    });
-
-    embed
-      .setDescription(
-        `${tracks}${queue.size > pageEnd
-          ? `\nand... \`${queue.totalSize - pageEnd}\` more track(s)`
-          : ''
-        }`
-      )
-      .setColor('DARK_GREEN');
-
-    return embed;
-  },
-
-  QueSetButtons: function (queue, guildId, page)
-  {
-    let previous = false;
-    if (page <= 0.1) previous = true;
-    else previous = false;
-    let next = true;
-
-    // const currPage = (page/10)+1
-    const currPage = page++;
-    if (currPage >= Math.floor((queue.totalSize - 1) / 10)) next = true;
-    else next = false;
-
-    const pages = `Page: ${currPage + 1} / ${Math.floor((queue.totalSize - 1) / 10) + 1
-      }`;
-
-    const buttons = new MessageActionRow().addComponents(
-      new MessageButton()
-        .setCustomId('quePrevious')
-        .setEmoji('<:arrowleft:930879597178929153>')
-        .setStyle('SECONDARY')
-        .setDisabled(previous),
-      new MessageButton()
-        .setCustomId('quePages')
-        .setLabel(pages)
-        .setStyle('SECONDARY')
-        .setDisabled(true),
-      new MessageButton()
-        .setCustomId('queNext')
-        .setEmoji('<:arrowright:930879597472518145>')
-        .setStyle('SECONDARY')
-        .setDisabled(next)
-    );
-
-    return buttons;
-  },
+	data: new SlashCommandBuilder().setName('queue').setDescription('View queue'),
+
+	async execute(interaction, client) {
+		let page = 0;
+
+		const player = interaction.client.manager.get(interaction.guild.id);
+		if (!player)
+			return replyInteractionEmbed(
+				interaction,
+				'ERROR',
+				'Please request a Song before using this Command.',
+				'DARK_RED'
+			);
+
+		const queue = player.queue;
+
+		await interaction.reply({
+			embeds: [this.QueSetEmbed(queue, interaction.guild.id, page)],
+			components: [this.QueSetButtons(queue, interaction.guild.id, page)],
+			ephemeral: true,
+		});
+
+		/** ++ Button Collector ++ */
+		const filter = (button) =>
+			(button.customId === 'quePrevious' || button.customId === 'queNext') &&
+			button.user.id === interaction.user.id &&
+			interaction.id === button.message.interaction.id;
+
+		const collector = interaction.channel.createMessageComponentCollector({
+			filter,
+		});
+		collector.on('collect', async (button) => {
+			switch (button.customId) {
+				case 'quePrevious':
+					await page--;
+					await button.update({
+						embeds: [this.QueSetEmbed(queue, interaction.guild.id, page)],
+						components: [this.QueSetButtons(queue, interaction.guild.id, page)],
+					});
+					break;
+
+				case 'queNext':
+					await page++;
+					await button.update({
+						embeds: [this.QueSetEmbed(queue, interaction.guild.id, page)],
+						components: [this.QueSetButtons(queue, interaction.guild.id, page)],
+					});
+					break;
+			}
+		});
+		/** -- Button Collector -- */
+	},
+
+	QueSetEmbed: function (queue, guildId, page) {
+		const embed = new MessageEmbed()
+			.setTitle('**<:playlistmusic:930887305697325148> | Queue**')
+			.setTimestamp()
+			.setColor('DARK_GREEN');
+
+		if (page <= 0) page = 0;
+		const pageStart = 10 * page;
+		const pageEnd = pageStart + 10;
+
+		let tracks = `\`Now Playing.\` ** | [${queue.current.title} by ${queue.current.author}](${queue.current.uri})**`;
+
+		queue.slice(pageStart, pageEnd).map((track, i) => {
+			let pos = i + pageStart + 1;
+			return (tracks += `\n\`${pos}.\` ** | [${track.title} by ${track.author}](${track.uri})**`);
+		});
+
+		embed
+			.setDescription(
+				`${tracks}${
+					queue.size > pageEnd
+						? `\nand... \`${queue.totalSize - pageEnd}\` more track(s)`
+						: ''
+				}`
+			)
+			.setColor('DARK_GREEN');
+
+		return embed;
+	},
+
+	QueSetButtons: function (queue, guildId, page) {
+		let previous = false;
+		if (page <= 0.1) previous = true;
+		else previous = false;
+		let next = true;
+
+		// const currPage = (page/10)+1
+		const currPage = page++;
+		if (currPage >= Math.floor((queue.totalSize - 1) / 10)) next = true;
+		else next = false;
+
+		const pages = `Page: ${currPage + 1} / ${
+			Math.floor((queue.totalSize - 1) / 10) + 1
+		}`;
+
+		const buttons = new MessageActionRow().addComponents(
+			new MessageButton()
+				.setCustomId('quePrevious')
+				.setEmoji('<:arrowleft:930879597178929153>')
+				.setStyle('SECONDARY')
+				.setDisabled(previous),
+			new MessageButton()
+				.setCustomId('quePages')
+				.setLabel(pages)
+				.setStyle('SECONDARY')
+				.setDisabled(true),
+			new MessageButton()
+				.setCustomId('queNext')
+				.setEmoji('<:arrowright:930879597472518145>')
+				.setStyle('SECONDARY')
+				.setDisabled(next)
+		);
+
+		return buttons;
+	},
 };

From 722223e99f23a18e55907d6334bbd03810dd26c7 Mon Sep 17 00:00:00 2001
From: Botis <barnekiel@gmail.com>
Date: Sun, 13 Feb 2022 13:38:28 +0100
Subject: [PATCH 14/29] Format and fixed one error

---
 src/events/music/nodeConnect.js | 21 +++++++++++----------
 src/events/music/nodeError.js   | 23 +++++++++++++----------
 2 files changed, 24 insertions(+), 20 deletions(-)

diff --git a/src/events/music/nodeConnect.js b/src/events/music/nodeConnect.js
index 6da1926..aab4cd5 100644
--- a/src/events/music/nodeConnect.js
+++ b/src/events/music/nodeConnect.js
@@ -1,11 +1,12 @@
-module.exports = async (client, node) =>
-{
-  const text = `Node "${node.options.identifier}" connected.`;
-  console.log('╭' + '─'.repeat(65) + '╮');
-  console.log(
-    '│ ' + ' '.repeat((64 - text.length) / 2) +
-    text + ' '.repeat((63 - text.length) / 2) +
-    ' │'
-  );
-  console.log('╰' + '─'.repeat(65) + '╯');
+module.exports = async (client, node) => {
+	const text = `Node "${node.options.identifier}" connected.`;
+	console.log('╭' + '─'.repeat(65) + '╮');
+	console.log(
+		'│ ' +
+			' '.repeat((64 - text.length) / 2) +
+			text +
+			' '.repeat((63 - text.length) / 2) +
+			' │'
+	);
+	console.log('╰' + '─'.repeat(65) + '╯');
 };
diff --git a/src/events/music/nodeError.js b/src/events/music/nodeError.js
index 79d6ae9..957fefb 100644
--- a/src/events/music/nodeError.js
+++ b/src/events/music/nodeError.js
@@ -1,12 +1,15 @@
-module.exports = async (client, node, error) =>
-{
-  const text = `Node "${node.options.identifier}" encountered an error: ${error.message}.`;
+module.exports = async (client, node, error) => {
+	const text = `Node "${node.options.identifier}" encountered an error.`;
 
-  console.log('╭' + '─'.repeat(65) + '╮');
-  console.log(
-    '│ ' + ' '.repeat((64 - text.length) / 2) +
-    text + ' '.repeat((63 - text.length) / 2) +
-    ' │'
-  );
-  console.log('╰' + '─'.repeat(65) + '╯');
+	console.log('╭' + '─'.repeat(65) + '╮');
+	console.log(
+		'│ ' +
+			' '.repeat((64 - text.length) / 2) +
+			text +
+			' '.repeat((63 - text.length) / 2) +
+			' │'
+	);
+	console.log('╰' + '─'.repeat(65) + '╯');
+
+	console.log(`Error: ${error.message}`);
 };

From 3453d7eb2b3903fd90b5ddf8722cfcd873579371 Mon Sep 17 00:00:00 2001
From: Botis <barnekiel@gmail.com>
Date: Sun, 13 Feb 2022 14:10:25 +0100
Subject: [PATCH 15/29] =?UTF-8?q?inside=20Queues,=20ChannelID=20won=C2=B4t?=
 =?UTF-8?q?=20=20be=20always=20visible?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 src/commands/music/queue.js                |  12 +-
 src/modules/channelModule/channelModule.js | 746 +++++++++++----------
 2 files changed, 389 insertions(+), 369 deletions(-)

diff --git a/src/commands/music/queue.js b/src/commands/music/queue.js
index f74f34f..831d4ed 100644
--- a/src/commands/music/queue.js
+++ b/src/commands/music/queue.js
@@ -68,11 +68,19 @@ module.exports = {
 		const pageStart = 10 * page;
 		const pageEnd = pageStart + 10;
 
-		let tracks = `\`Now Playing.\` ** | [${queue.current.title} by ${queue.current.author}](${queue.current.uri})**`;
+		let tracks = '';
+
+		queue.current.title.includes(queue.current.author)
+			? (tracks = `\`Now Playing.\` ** | [${queue.current.title}](${queue.current.uri})**`)
+			: (tracks = `\`Now Playing.\` ** | [${queue.current.title} by ${queue.current.author}](${queue.current.uri})**`);
 
 		queue.slice(pageStart, pageEnd).map((track, i) => {
 			let pos = i + pageStart + 1;
-			return (tracks += `\n\`${pos}.\` ** | [${track.title} by ${track.author}](${track.uri})**`);
+
+			if (track.title.includes(track.author))
+				return (tracks += `\n\`${pos}.\` ** | [${track.title}](${track.uri})**`);
+			else
+				return (tracks += `\n\`${pos}.\` ** | [${track.title} by ${track.author}](${track.uri})**`);
 		});
 
 		embed
diff --git a/src/modules/channelModule/channelModule.js b/src/modules/channelModule/channelModule.js
index 3f49d51..2801915 100644
--- a/src/modules/channelModule/channelModule.js
+++ b/src/modules/channelModule/channelModule.js
@@ -1,7 +1,7 @@
 const {
-  guildExists,
-  getGuildChannel,
-  getGuildChannelEmbed,
+	guildExists,
+	getGuildChannel,
+	getGuildChannelEmbed,
 } = require('../databaseModule/databaseModule');
 
 const { createEmbed } = require('../embedModule/embedModule');
@@ -11,368 +11,380 @@ const format = require('format-duration');
 const checkLinks = require('check-links');
 
 module.exports = {
-  createChannel: async function (guild)
-  {
-    const channel = await guild.channels.create('golden-song-requests', {
-      type: 'text',
-      permissionOverwrites: [
-        {
-          id: guild.roles.everyone,
-          allow: ['VIEW_CHANNEL'],
-        },
-      ],
-    });
-
-    return channel;
-  },
-
-  populateChannel: async function (guild)
-  {
-    const guildId = guild.id;
-    const channelId = await getGuildChannel(guildId);
-    const channel = await guild.channels.cache.get(channelId);
-
-    const channelHero = await channel.send(process.env.GOLDEN_HEADER);
-
-    const channelControlComponent = new MessageActionRow()
-      .addComponents(
-        new MessageButton()
-          .setCustomId('playpause')
-          .setEmoji('<:playpause:930535466908934144>')
-          .setStyle('SECONDARY')
-      )
-      .addComponents(
-        new MessageButton()
-          .setCustomId('stop')
-          .setEmoji('<:stop:930538012805333122>')
-          .setStyle('SECONDARY')
-      )
-      .addComponents(
-        new MessageButton()
-          .setCustomId('skip')
-          .setEmoji('<:skip:930535779887874110>')
-          .setStyle('SECONDARY')
-      )
-      .addComponents(
-        new MessageButton()
-          .setCustomId('shuffle')
-          .setEmoji('<:shuffle:930534110185783386>')
-          .setStyle('SECONDARY')
-      )
-      .addComponents(
-        new MessageButton()
-          .setEmoji('<:youtube:930538416771313755>')
-          .setStyle('LINK')
-          .setURL('https://golden.spasten.studio/')
-          .setDisabled(true)
-      );
-
-    const channelEmbed = new MessageEmbed()
-      .setColor('DARK_BUT_NOT_BLACK')
-      .setTitle(process.env.GOLDEN_EMBED_TITLE)
-      .setDescription(process.env.GOLDEN_EMBED_DESCRIPTION)
-      .setImage(process.env.GOLDEN_EMBED_THUMBNAIL)
-      .setFooter({ text: `0 songs in queue | Volume: 100%  | Loop: Disabled` });
-
-    const channelEmbedMessage = await channel
-      .send({
-        content: process.env.GOLDEN_EMBED_MESSAGE,
-        embeds: [channelEmbed],
-        components: [channelControlComponent],
-      })
-      .catch((e) => { });
-
-    return { channelHero: channelHero, channelEmbed: channelEmbedMessage };
-  },
-
-  deleteChannel: async function (guild)
-  {
-    const guildId = guild.id;
-    const channelId = await getGuildChannel(guildId);
-    const channel = await guild.channels.cache.get(channelId);
-    if (channel === undefined) return;
-
-    return channel.delete();
-  },
-
-  channelExists: async function (guild)
-  {
-    const guildId = guild.id;
-    return (
-      await guildExists(guildId) &&
-      guild.channels.cache.get(await getGuildChannel(guildId)) !== undefined
-    );
-  },
-
-  channelEmbedExists: async function (guildId, client)
-  {
-    const embedMessageId = await getGuildChannelEmbed(guildId);
-    const channelId = await getGuildChannel(guildId);
-    const channel = client.channels.cache.get(channelId);
-
-    if (channel === undefined) return false;
-    return (
-      (await channel.messages.fetch(embedMessageId).catch((e) => { })) !==
-      undefined
-    );
-  },
-
-  setEmbed: async function (guild, player)
-  {
-    if (await module.exports.channelExists(guild))
-    {
-      const channelId = await getGuildChannel(guild.id); // ID of the golden channel for this guild
-      const channelEmbedId = await getGuildChannelEmbed(guild.id); // ID of the player Embed inside the golden channel
-
-      const channel = await guild.channels.cache.get(channelId); // Fetched channel
-      const channelEmbed = await channel.messages.fetch(channelEmbedId); // Fetched player embed
-
-      if (channelEmbed.embeds[0] === undefined)
-        return channel.send({
-          embeds: [
-            createEmbed(
-              'Broken channel',
-              'Sorry but it seems like the channel is broken. Please create a new one!',
-              'DARK_RED',
-              'https://cdn.discordapp.com/attachments/922836431045525525/922841155098533928/warn.png'
-            ),
-          ],
-        }); // e.g. embed was removed from message manually
-
-      const duration = player.queue.current.isStream
-        ? 'LIVE'
-        : format(player.queue.current.duration);
-
-      if (!player.get(`autoplay`))
-        channelEmbed.embeds[0].title = `<:musicnote:930887306045435934> | Now playing: ${player.queue.current.title} by ${player.queue.current.author} [${duration}]`;
-      else
-        channelEmbed.embeds[0].title = `<:auto:931241431979417661> | Now playing: ${player.queue.current.title} by ${player.queue.current.author} [${duration}]`;
-
-      const currComponents = channelEmbed.components[0];
-      if (currComponents !== undefined)
-      {
-        if (player.queue.current.uri !== '')
-        {
-          for (const button of currComponents.components)
-          {
-            if (button.style === 'LINK')
-            {
-              button.disabled = false;
-              button.url = `https://www.youtube.com/watch?v=${player.queue.current.identifier}`;
-            }
-          }
-        } else
-        {
-          for (const button of currComponents.components)
-          {
-            if (button.style === 'LINK')
-            {
-              button.disabled = true;
-              button.url = 'https://golden.spasten.studio';
-            }
-          }
-        }
-      }
-
-      if (player.queue.current.thumbnail === null)
-      {
-        // if there's no thumbnail (e.g. SoundCloud or radio link)
-        channelEmbed.embeds[0].image.url = process.env.GOLDEN_EMBED_THUMBNAIL;
-      } else
-      {
-        let trackThumbnail = await player.queue.current.displayThumbnail("maxresdefault");
-        const checkedLinks = await checkLinks([trackThumbnail]);
-
-        if (checkedLinks[trackThumbnail].status === "dead") // there is no maxres thumbnail
-          trackThumbnail = await player.queue.current.displayThumbnail("hqdefault"); // use a lower quality res one instead
-
-        channelEmbed.embeds[0].image.url = trackThumbnail;
-      }
-
-      const loop = player.trackRepeat
-        ? 'Track'
-        : player.queueRepeat
-          ? 'Queue'
-          : 'Disabled';
-      const paused = player.paused ? '| Paused' : '';
-
-      channelEmbed.embeds[0].footer = {
-        text: `${player.queue.length} song${player.queue.length === 1 ? '' : 's'
-          } in queue | Volume: ${player.volume}% | Loop: ${loop} ${paused}`,
-      };
-
-      channelEmbed.edit({
-        content: module.exports.generateQueue(player.queue),
-        embeds: [new MessageEmbed(channelEmbed.embeds[0])],
-        components: [new MessageActionRow(currComponents)],
-      });
-    }
-  },
-
-  resetChannel: async function (guild, volume)
-  {
-    if (volume === undefined) volume = 100;
-
-    if (await module.exports.channelExists(guild))
-    {
-      const channelId = await getGuildChannel(guild.id); // ID of the golden channel for this guild
-      const channelEmbedId = await getGuildChannelEmbed(guild.id); // ID of the player Embed inside the golden channel
-
-      const channel = await guild.channels.cache.get(channelId); // Fetched channel
-      const channelEmbed = await channel.messages.fetch(channelEmbedId); // Fetched player embed
-
-      if (channelEmbed.embeds[0] === undefined)
-        return channel.send({
-          embeds: [
-            createEmbed(
-              'Broken channel',
-              'Sorry but it seems like the channel is broken. Please create a new one!',
-              'DARK_RED',
-              'https://cdn.discordapp.com/attachments/922836431045525525/922841155098533928/warn.png'
-            ),
-          ],
-        }); // e.g. embed was removed from message manually
-
-      channelEmbed.embeds[0].title = process.env.GOLDEN_EMBED_TITLE;
-
-      const currComponents = channelEmbed.components[0];
-      for (const button of currComponents.components)
-      {
-        if (button.style === 'LINK')
-        {
-          button.disabled = true;
-          button.url = 'https://golden.spasten.studio';
-        }
-      }
-
-      channelEmbed.embeds[0].image = { url: process.env.GOLDEN_EMBED_THUMBNAIL };
-      channelEmbed.embeds[0].footer = {
-        text: `0 songs in queue | Volume: ${volume}% | Loop: Disabled`,
-      };
-
-      channelEmbed.edit({
-        content: process.env.GOLDEN_EMBED_MESSAGE,
-        embeds: [new MessageEmbed(channelEmbed.embeds[0])],
-        components: [new MessageActionRow(currComponents)],
-      });
-    }
-  },
-
-  sendTemporaryMessage: async function (channel, content, time)
-  {
-    channel.send(content).then((msg) =>
-    {
-      setTimeout(() => msg.delete().catch((e) => { }), time);
-    });
-  },
-
-  replyInteractionEmbed: async function (interaction, title, description, color, thumbnailUrl)
-  {
-    if (interaction.channel.id === getGuildChannel(interaction.guild.id))
-    {
-      await interaction.reply({
-        embeds: [createEmbed(title, description, color, thumbnailUrl)],
-      });
-      setTimeout(() => interaction.deleteReply().catch((e) => { }), 10000);
-    } else
-    {
-      await interaction.reply({
-        embeds: [createEmbed(title, description, color, thumbnailUrl)],
-        ephemeral: true,
-      });
-    }
-  },
-
-  replyEphemeralInteractionEmbed: async function (interaction, title, description, color, thumbnailUrl)
-  {
-    await interaction.reply({
-      embeds: [createEmbed(title, description, color, thumbnailUrl)],
-      ephemeral: true,
-    });
-  },
-
-  replyBtnInteractionEmbed: async function (interaction, title, description, color, thumbnailUrl, buttons)
-  {
-    await interaction.reply({
-      embeds: [createEmbed(title, description, color, thumbnailUrl)],
-      components: [buttons],
-      ephemeral: true,
-    });
-  },
-
-  editInteractionEmbed: async function (interaction, title, description, color, thumbnailUrl)
-  {
-    interaction.editReply({
-      embeds: [createEmbed(title, description, color, thumbnailUrl)],
-    });
-  },
-
-  editBtnInteractionEmbed: async function (interaction, title, description, color, thumbnailUrl)
-  {
-    interaction.editReply({
-      embeds: [createEmbed(title, description, color, thumbnailUrl)],
-    });
-  },
-
-  replyInteractionMessage: async function (interaction, message)
-  {
-    if (interaction.channel.id === getGuildChannel(interaction.guild.id))
-    {
-      await interaction.reply(message);
-      setTimeout(() => interaction.deleteReply().catch((e) => { }), 10000);
-    } else
-    {
-      await interaction.reply({ content: message, ephemeral: true });
-    }
-  },
-
-  generateQueue: function (queue)
-  {
-    if (queue.length < 1) return process.env.GOLDEN_EMBED_MESSAGE;
-
-    let contentLength = 0;
-    const formattedQueueArray = [];
-
-    for (var i = 0; i <= queue.length; i++)
-    {
-      const track = queue[i];
-      let index = i;
-
-      if (track === undefined) continue;
-      contentLength += track.title.length;
-
-      if (contentLength > 450)
-      {
-        formattedQueueArray.push(`\nAnd **${queue.length - i}** more tracks`);
-        formattedQueueArray.push('\n__**Queue:**__');
-        return formattedQueueArray.reverse().join('');
-      }
-
-      const duration = track.isStream ? 'LIVE' : format(track.duration);
-      formattedQueueArray.push(
-        `\n${++index}. ${track.title} by ${track.author} [${duration}]`
-      );
-    }
-
-    formattedQueueArray.push('\n__**Queue:**__');
-    return formattedQueueArray.reverse().join('');
-  },
-
-  generateProgressBar: function (ms, duration)
-  {
-    const part = Math.floor((ms / duration) * 10);
-    return '═'.repeat(part) + '🟢' + '═'.repeat(10 - part);
-  },
-
-  countAllListeningMembers: async function (client) {
-    let members = 0;
-    for (const [guild, playerData] of client.manager.players.entries()) {
-      const cachedGuild = await client.guilds.cache.get(guild);
-      const channel = await cachedGuild.channels.cache.get(playerData.voiceChannel);
-      members += channel.members.size;
-
-      if (channel.members.has(client.user.id)) members--; // If Golden is already in the music channel: do not count him
-    }
-    return members;
-  }
+	createChannel: async function (guild) {
+		const channel = await guild.channels.create('golden-song-requests', {
+			type: 'text',
+			permissionOverwrites: [
+				{
+					id: guild.roles.everyone,
+					allow: ['VIEW_CHANNEL'],
+				},
+			],
+		});
+
+		return channel;
+	},
+
+	populateChannel: async function (guild) {
+		const guildId = guild.id;
+		const channelId = await getGuildChannel(guildId);
+		const channel = await guild.channels.cache.get(channelId);
+
+		const channelHero = await channel.send(process.env.GOLDEN_HEADER);
+
+		const channelControlComponent = new MessageActionRow()
+			.addComponents(
+				new MessageButton()
+					.setCustomId('playpause')
+					.setEmoji('<:playpause:930535466908934144>')
+					.setStyle('SECONDARY')
+			)
+			.addComponents(
+				new MessageButton()
+					.setCustomId('stop')
+					.setEmoji('<:stop:930538012805333122>')
+					.setStyle('SECONDARY')
+			)
+			.addComponents(
+				new MessageButton()
+					.setCustomId('skip')
+					.setEmoji('<:skip:930535779887874110>')
+					.setStyle('SECONDARY')
+			)
+			.addComponents(
+				new MessageButton()
+					.setCustomId('shuffle')
+					.setEmoji('<:shuffle:930534110185783386>')
+					.setStyle('SECONDARY')
+			)
+			.addComponents(
+				new MessageButton()
+					.setEmoji('<:youtube:930538416771313755>')
+					.setStyle('LINK')
+					.setURL('https://golden.spasten.studio/')
+					.setDisabled(true)
+			);
+
+		const channelEmbed = new MessageEmbed()
+			.setColor('DARK_BUT_NOT_BLACK')
+			.setTitle(process.env.GOLDEN_EMBED_TITLE)
+			.setDescription(process.env.GOLDEN_EMBED_DESCRIPTION)
+			.setImage(process.env.GOLDEN_EMBED_THUMBNAIL)
+			.setFooter({ text: `0 songs in queue | Volume: 100%  | Loop: Disabled` });
+
+		const channelEmbedMessage = await channel
+			.send({
+				content: process.env.GOLDEN_EMBED_MESSAGE,
+				embeds: [channelEmbed],
+				components: [channelControlComponent],
+			})
+			.catch((e) => {});
+
+		return { channelHero: channelHero, channelEmbed: channelEmbedMessage };
+	},
+
+	deleteChannel: async function (guild) {
+		const guildId = guild.id;
+		const channelId = await getGuildChannel(guildId);
+		const channel = await guild.channels.cache.get(channelId);
+		if (channel === undefined) return;
+
+		return channel.delete();
+	},
+
+	channelExists: async function (guild) {
+		const guildId = guild.id;
+		return (
+			(await guildExists(guildId)) &&
+			guild.channels.cache.get(await getGuildChannel(guildId)) !== undefined
+		);
+	},
+
+	channelEmbedExists: async function (guildId, client) {
+		const embedMessageId = await getGuildChannelEmbed(guildId);
+		const channelId = await getGuildChannel(guildId);
+		const channel = client.channels.cache.get(channelId);
+
+		if (channel === undefined) return false;
+		return (
+			(await channel.messages.fetch(embedMessageId).catch((e) => {})) !==
+			undefined
+		);
+	},
+
+	setEmbed: async function (guild, player) {
+		if (await module.exports.channelExists(guild)) {
+			const channelId = await getGuildChannel(guild.id); // ID of the golden channel for this guild
+			const channelEmbedId = await getGuildChannelEmbed(guild.id); // ID of the player Embed inside the golden channel
+
+			const channel = await guild.channels.cache.get(channelId); // Fetched channel
+			const channelEmbed = await channel.messages.fetch(channelEmbedId); // Fetched player embed
+
+			if (channelEmbed.embeds[0] === undefined)
+				return channel.send({
+					embeds: [
+						createEmbed(
+							'Broken channel',
+							'Sorry but it seems like the channel is broken. Please create a new one!',
+							'DARK_RED',
+							'https://cdn.discordapp.com/attachments/922836431045525525/922841155098533928/warn.png'
+						),
+					],
+				}); // e.g. embed was removed from message manually
+
+			const duration = player.queue.current.isStream
+				? 'LIVE'
+				: format(player.queue.current.duration);
+
+			let title = player.queue.current.title.includes(
+				player.queue.current.author
+			)
+				? (title = `Now playing: ${player.queue.current.title} [${duration}]`)
+				: (title = `Now playing: ${player.queue.current.title} by ${player.queue.current.author} [${duration}]`);
+
+			player.get(`autoplay`)
+				? (channelEmbed.embeds[0].title = `<:auto:931241431979417661> | ${title}`)
+				: (channelEmbed.embeds[0].title = `<:musicnote:930887306045435934> | ${title}`);
+
+			const currComponents = channelEmbed.components[0];
+			if (currComponents !== undefined) {
+				if (player.queue.current.uri !== '') {
+					for (const button of currComponents.components) {
+						if (button.style === 'LINK') {
+							button.disabled = false;
+							button.url = `https://www.youtube.com/watch?v=${player.queue.current.identifier}`;
+						}
+					}
+				} else {
+					for (const button of currComponents.components) {
+						if (button.style === 'LINK') {
+							button.disabled = true;
+							button.url = 'https://golden.spasten.studio';
+						}
+					}
+				}
+			}
+
+			if (player.queue.current.thumbnail === null) {
+				// if there's no thumbnail (e.g. SoundCloud or radio link)
+				channelEmbed.embeds[0].image.url = process.env.GOLDEN_EMBED_THUMBNAIL;
+			} else {
+				let trackThumbnail = await player.queue.current.displayThumbnail(
+					'maxresdefault'
+				);
+				const checkedLinks = await checkLinks([trackThumbnail]);
+
+				if (checkedLinks[trackThumbnail].status === 'dead')
+					// there is no maxres thumbnail
+					trackThumbnail = await player.queue.current.displayThumbnail(
+						'hqdefault'
+					); // use a lower quality res one instead
+
+				channelEmbed.embeds[0].image.url = trackThumbnail;
+			}
+
+			const loop = player.trackRepeat
+				? 'Track'
+				: player.queueRepeat
+				? 'Queue'
+				: 'Disabled';
+			const paused = player.paused ? '| Paused' : '';
+
+			channelEmbed.embeds[0].footer = {
+				text: `${player.queue.length} song${
+					player.queue.length === 1 ? '' : 's'
+				} in queue | Volume: ${player.volume}% | Loop: ${loop} ${paused}`,
+			};
+
+			channelEmbed.edit({
+				content: module.exports.generateQueue(player.queue),
+				embeds: [new MessageEmbed(channelEmbed.embeds[0])],
+				components: [new MessageActionRow(currComponents)],
+			});
+		}
+	},
+
+	resetChannel: async function (guild, volume) {
+		if (volume === undefined) volume = 100;
+
+		if (await module.exports.channelExists(guild)) {
+			const channelId = await getGuildChannel(guild.id); // ID of the golden channel for this guild
+			const channelEmbedId = await getGuildChannelEmbed(guild.id); // ID of the player Embed inside the golden channel
+
+			const channel = await guild.channels.cache.get(channelId); // Fetched channel
+			const channelEmbed = await channel.messages.fetch(channelEmbedId); // Fetched player embed
+
+			if (channelEmbed.embeds[0] === undefined)
+				return channel.send({
+					embeds: [
+						createEmbed(
+							'Broken channel',
+							'Sorry but it seems like the channel is broken. Please create a new one!',
+							'DARK_RED',
+							'https://cdn.discordapp.com/attachments/922836431045525525/922841155098533928/warn.png'
+						),
+					],
+				}); // e.g. embed was removed from message manually
+
+			channelEmbed.embeds[0].title = process.env.GOLDEN_EMBED_TITLE;
+
+			const currComponents = channelEmbed.components[0];
+			for (const button of currComponents.components) {
+				if (button.style === 'LINK') {
+					button.disabled = true;
+					button.url = 'https://golden.spasten.studio';
+				}
+			}
+
+			channelEmbed.embeds[0].image = {
+				url: process.env.GOLDEN_EMBED_THUMBNAIL,
+			};
+			channelEmbed.embeds[0].footer = {
+				text: `0 songs in queue | Volume: ${volume}% | Loop: Disabled`,
+			};
+
+			channelEmbed.edit({
+				content: process.env.GOLDEN_EMBED_MESSAGE,
+				embeds: [new MessageEmbed(channelEmbed.embeds[0])],
+				components: [new MessageActionRow(currComponents)],
+			});
+		}
+	},
+
+	sendTemporaryMessage: async function (channel, content, time) {
+		channel.send(content).then((msg) => {
+			setTimeout(() => msg.delete().catch((e) => {}), time);
+		});
+	},
+
+	replyInteractionEmbed: async function (
+		interaction,
+		title,
+		description,
+		color,
+		thumbnailUrl
+	) {
+		if (interaction.channel.id === getGuildChannel(interaction.guild.id)) {
+			await interaction.reply({
+				embeds: [createEmbed(title, description, color, thumbnailUrl)],
+			});
+			setTimeout(() => interaction.deleteReply().catch((e) => {}), 10000);
+		} else {
+			await interaction.reply({
+				embeds: [createEmbed(title, description, color, thumbnailUrl)],
+				ephemeral: true,
+			});
+		}
+	},
+
+	replyEphemeralInteractionEmbed: async function (
+		interaction,
+		title,
+		description,
+		color,
+		thumbnailUrl
+	) {
+		await interaction.reply({
+			embeds: [createEmbed(title, description, color, thumbnailUrl)],
+			ephemeral: true,
+		});
+	},
+
+	replyBtnInteractionEmbed: async function (
+		interaction,
+		title,
+		description,
+		color,
+		thumbnailUrl,
+		buttons
+	) {
+		await interaction.reply({
+			embeds: [createEmbed(title, description, color, thumbnailUrl)],
+			components: [buttons],
+			ephemeral: true,
+		});
+	},
+
+	editInteractionEmbed: async function (
+		interaction,
+		title,
+		description,
+		color,
+		thumbnailUrl
+	) {
+		interaction.editReply({
+			embeds: [createEmbed(title, description, color, thumbnailUrl)],
+		});
+	},
+
+	editBtnInteractionEmbed: async function (
+		interaction,
+		title,
+		description,
+		color,
+		thumbnailUrl
+	) {
+		interaction.editReply({
+			embeds: [createEmbed(title, description, color, thumbnailUrl)],
+		});
+	},
+
+	replyInteractionMessage: async function (interaction, message) {
+		if (interaction.channel.id === getGuildChannel(interaction.guild.id)) {
+			await interaction.reply(message);
+			setTimeout(() => interaction.deleteReply().catch((e) => {}), 10000);
+		} else {
+			await interaction.reply({ content: message, ephemeral: true });
+		}
+	},
+
+	generateQueue: function (queue) {
+		if (queue.length < 1) return process.env.GOLDEN_EMBED_MESSAGE;
+
+		let contentLength = 0;
+		const formattedQueueArray = [];
+
+		for (var i = 0; i <= queue.length; i++) {
+			const track = queue[i];
+			let index = i;
+
+			if (track === undefined) continue;
+			contentLength += track.title.length;
+
+			if (contentLength > 450) {
+				formattedQueueArray.push(`\nAnd **${queue.length - i}** more tracks`);
+				formattedQueueArray.push('\n__**Queue:**__');
+				return formattedQueueArray.reverse().join('');
+			}
+
+			const duration = track.isStream ? 'LIVE' : format(track.duration);
+			const title = track.title.includes(track.author)
+				? `\n${++index}. ${track.title}[${duration}]`
+				: `\n${++index}. ${track.title} by ${track.author} [${duration}]`;
+
+			formattedQueueArray.push(title);
+		}
+
+		formattedQueueArray.push('\n__**Queue:**__');
+		return formattedQueueArray.reverse().join('');
+	},
+
+	generateProgressBar: function (ms, duration) {
+		const part = Math.floor((ms / duration) * 10);
+		return '═'.repeat(part) + '🟢' + '═'.repeat(10 - part);
+	},
+
+	countAllListeningMembers: async function (client) {
+		let members = 0;
+		for (const [guild, playerData] of client.manager.players.entries()) {
+			const cachedGuild = await client.guilds.cache.get(guild);
+			const channel = await cachedGuild.channels.cache.get(
+				playerData.voiceChannel
+			);
+			members += channel.members.size;
+
+			if (channel.members.has(client.user.id)) members--; // If Golden is already in the music channel: do not count him
+		}
+		return members;
+	},
 };

From 05f8d3787a54ef9bf1a3b9f9b7acf554d26a8514 Mon Sep 17 00:00:00 2001
From: Botis <barnekiel@gmail.com>
Date: Sun, 13 Feb 2022 14:15:46 +0100
Subject: [PATCH 16/29] crash fix

---
 src/modules/channelModule/channelModule.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/channelModule/channelModule.js b/src/modules/channelModule/channelModule.js
index 2801915..d664a7d 100644
--- a/src/modules/channelModule/channelModule.js
+++ b/src/modules/channelModule/channelModule.js
@@ -139,8 +139,8 @@ module.exports = {
 			let title = player.queue.current.title.includes(
 				player.queue.current.author
 			)
-				? (title = `Now playing: ${player.queue.current.title} [${duration}]`)
-				: (title = `Now playing: ${player.queue.current.title} by ${player.queue.current.author} [${duration}]`);
+				? `Now playing: ${player.queue.current.title} [${duration}]`
+				: `Now playing: ${player.queue.current.title} by ${player.queue.current.author} [${duration}]`;
 
 			player.get(`autoplay`)
 				? (channelEmbed.embeds[0].title = `<:auto:931241431979417661> | ${title}`)

From a465bc11c0c4261a027c40eb3bba64e68ac926a5 Mon Sep 17 00:00:00 2001
From: Botis <barnekiel@gmail.com>
Date: Sun, 13 Feb 2022 15:27:28 +0100
Subject: [PATCH 17/29] finished Development for /skip command

---
 src/commands/music/skip.js | 150 ++++++++++++++++++++++++++-----------
 1 file changed, 107 insertions(+), 43 deletions(-)

diff --git a/src/commands/music/skip.js b/src/commands/music/skip.js
index 0923ae9..e6da461 100644
--- a/src/commands/music/skip.js
+++ b/src/commands/music/skip.js
@@ -1,46 +1,110 @@
-const { SlashCommandBuilder } = require("@discordjs/builders");
-const { replyInteractionEmbed } = require("../../modules/channelModule/channelModule");
+const { SlashCommandBuilder } = require('@discordjs/builders');
+const {
+	replyInteractionEmbed,
+} = require('../../modules/channelModule/channelModule');
 
 module.exports = {
-  data: new SlashCommandBuilder()
-    .setName("skip")
-    .setDescription("Skip current song")
-    .addIntegerOption((option) => option.setName('amount').setDescription('the amount of songs to be skipped'))
-    .addIntegerOption((option) => option.setName('queue_number').setDescription('the Number of the song in the Queue to which you want to Skip')),
-
-  async execute(interaction, client)
-  {
-    const amount = interaction.options.getString('amount');
-    const queue_number = interaction.options.getString('queue_number');
-    const player = interaction.client.manager.get(interaction.guild.id);
-    if (!player) return replyInteractionEmbed(interaction, '', 'Play a track before using this command.', 'DARK_RED');
-
-    const { channel } = interaction.member.voice;
-    if (!channel) return replyInteractionEmbed(interaction, '', 'Join a voice channel first.', 'DARK_RED');
-    if (channel.id !== player.voiceChannel) return replyInteractionEmbed(interaction, '', 'I\'ve to be in the same voice channel with you for requesting tracks.', 'DARK_RED');
-
-    if (!player.queue.current) return replyInteractionEmbed(interaction, '', 'There is no music playing.', 'DARK_RED');
-
-    const { title } = player.queue.current;
-
-    if (amount != undefined) 
-    {
-      if (player.queue.totalSize > amount)
-        return replyInteractionEmbed(interaction, '', `Queue isnt that Big ;).`, 'DARK_RED');
-      for (let i = 0; i <= amount; i++)
-        await player.play();
-      return replyInteractionEmbed(interaction, '', `Songs was skipped.`, 'DARK_GREEN');
-    }
-    else if (queue_number != undefined)
-    {
-      if (player.queue.size > queue_number)
-        return replyInteractionEmbed(interaction, '', `Queue isnt that Big ;).`, 'DARK_RED');
-      for (let i = 0; i <= queue_number; i++)
-        await player.play();
-      return replyInteractionEmbed(interaction, '', `Songs was skipped.`, 'DARK_GREEN');
-    }
-
-    player.play();
-    return replyInteractionEmbed(interaction, '', `${title} was skipped.`, 'DARK_GREEN');
-  },
+	data: new SlashCommandBuilder()
+		.setName('skip')
+		.setDescription('Skip current song')
+		.addIntegerOption((option) =>
+			option
+				.setName('amount')
+				.setDescription('the amount of songs to be skipped')
+		)
+		.addIntegerOption((option) =>
+			option
+				.setName('queue_number')
+				.setDescription(
+					'the Number of the song in the Queue to which you want to Skip'
+				)
+		),
+
+	async execute(interaction, client) {
+		const amount = interaction.options.getInteger('amount');
+		const queue_number = interaction.options.getInteger('queue_number');
+
+		const player = interaction.client.manager.get(interaction.guild.id);
+		const queue = player.queue;
+
+		if (!player)
+			return replyInteractionEmbed(
+				interaction,
+				'',
+				'Play a track before using this command.',
+				'DARK_RED'
+			);
+
+		const { channel } = interaction.member.voice;
+		if (!channel)
+			return replyInteractionEmbed(
+				interaction,
+				'',
+				'Join a voice channel first.',
+				'DARK_RED'
+			);
+		if (channel.id !== player.voiceChannel)
+			return replyInteractionEmbed(
+				interaction,
+				'',
+				"I've to be in the same voice channel with you for requesting tracks.",
+				'DARK_RED'
+			);
+
+		if (!player.queue.current)
+			return replyInteractionEmbed(
+				interaction,
+				'',
+				'There is no music playing.',
+				'DARK_RED'
+			);
+
+		const { title } = player.queue.current;
+
+		if (amount != undefined) {
+			if (player.queue.totalSize < amount)
+				return replyInteractionEmbed(
+					interaction,
+					'',
+					`Queue is not that Big, please use a smaller Number.`,
+					'DARK_RED'
+				);
+
+			await queue.remove(0, amount);
+			await player.stop();
+
+			return replyInteractionEmbed(
+				interaction,
+				'Songs were skipped',
+				`Now Playing ${queue.current.title}`,
+				'DARK_GREEN'
+			);
+		} else if (queue_number != undefined) {
+			if (player.queue.totalSize < queue_number)
+				return replyInteractionEmbed(
+					interaction,
+					'',
+					`Queue is not that Big, please use a smaller Number.`,
+					'DARK_RED'
+				);
+
+			await queue.remove(0, queue_number - 1);
+			await player.stop();
+
+			return replyInteractionEmbed(
+				interaction,
+				'Songs were skipped',
+				`Now Playing ${queue.current.title}`,
+				'DARK_GREEN'
+			);
+		}
+
+		player.stop();
+		return replyInteractionEmbed(
+			interaction,
+			'',
+			`${title} was skipped.`,
+			'DARK_GREEN'
+		);
+	},
 };

From d0a0ef49501715f1aa2af35a38bd6dc02de25ab4 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Mon, 14 Feb 2022 11:12:29 +0100
Subject: [PATCH 18/29] Fixed typo

---
 src/golden.js | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/golden.js b/src/golden.js
index b3d5f94..17446ed 100644
--- a/src/golden.js
+++ b/src/golden.js
@@ -12,7 +12,7 @@ const {
 } = require("./modules/handlerModule/handlerModule");
 
 if (!env.parsed)
-  return console.log('Fatal: config.env file missing or unreadable\nSetup instructions at https://github.com/spastenstudio/Golden')
+  return console.log('Fatal: config.env file missing or unreadable\nSetup instructions at https://github.com/spasten-studio/Golden')
 
 const client = new Client({
   shards: "auto",

From 45d99c22290dc36a031b79fec0e51b6cfd5c6332 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Mon, 14 Feb 2022 11:14:30 +0100
Subject: [PATCH 19/29] Corrected spacing

---
 data/template.env | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/data/template.env b/data/template.env
index 3341e29..985d530 100644
--- a/data/template.env
+++ b/data/template.env
@@ -11,11 +11,11 @@ GOLDEN_EMBED_DESCRIPTION="[Bot Invite](https://golden.invite.spasten.studio/) |
 GOLDEN_EMBED_MESSAGE="\n__**Queue:**__\nJoin a Voice Channel and add a Song or a Playlist"
 
 # Discord API see https://discord.com/developers/
-DISCORD_TOKEN= ""
-DISCORD_APPID= ""
+DISCORD_TOKEN=""
+DISCORD_APPID=""
 
 DISCORD_GLOBAL_COMMANDS=true
-DISCORD_GUILDID= ""
+DISCORD_GUILDID=""
 
 # MySQL / MariaDB
 DB_HOST="localhost"

From 83936b4fe79cea4b9e12eb42524760ce6bb9f694 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Mon, 14 Feb 2022 13:17:39 +0100
Subject: [PATCH 20/29] Fixed setup error

---
 src/modules/databaseModule/databaseModule.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/databaseModule/databaseModule.js b/src/modules/databaseModule/databaseModule.js
index 8840fb8..0419c9e 100644
--- a/src/modules/databaseModule/databaseModule.js
+++ b/src/modules/databaseModule/databaseModule.js
@@ -46,7 +46,7 @@ module.exports = {
   },
 
   addGuildIfNotExists: async function (guildId, guildName) {
-    if (!await module.exports.guildExists(guildId)) module.exports.addGuild(guildId, guildName)
+    if (!await module.exports.guildExists(guildId)) await module.exports.addGuild(guildId, guildName)
   },
 
   addGuild: async function (guildId, guildName) {
@@ -112,7 +112,7 @@ module.exports = {
   },
 
   addGuildIfNotExists: async function (guildId, guildName) {
-    if (!await module.exports.guildExists(guildId)) module.exports.addGuild(guildId, guildName);
+    if (!await module.exports.guildExists(guildId)) await module.exports.addGuild(guildId, guildName);
   },
 
 

From 23926c5b21b9e32f307b5c73d81ffa87786a3e3a Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Mon, 14 Feb 2022 13:52:00 +0100
Subject: [PATCH 21/29] Delete no longer existing registered commands

---
 src/events/generic/ready.js                |  3 +++
 src/modules/handlerModule/handlerModule.js | 20 ++++++++++++++++++++
 2 files changed, 23 insertions(+)

diff --git a/src/events/generic/ready.js b/src/events/generic/ready.js
index bbb10fc..47f71c9 100644
--- a/src/events/generic/ready.js
+++ b/src/events/generic/ready.js
@@ -3,6 +3,7 @@ const { getAllGuilds, setActiveListeners, setActivePlayers, closeConnection } =
 const { setRandomActivities } = require('../../modules/activityModule/activityModule');
 const { Uptime } = require('better-uptime');
 const { createTables } = require('../../modules/databaseModule/databaseModule')
+const { cleanCommands } = require('../../modules/handlerModule/handlerModule')
 
 module.exports = {
     name: 'ready',
@@ -44,6 +45,8 @@ module.exports = {
                 resetChannel(cachedGuild);
         }
 
+        cleanCommands(client) // delete registered commands, which no longer exists in the bot
+
         if (process.env.BETTERUPTIME_ENABLED === 'true')
             new Uptime({
                 url: process.env.BETTERUPTIME_URL,
diff --git a/src/modules/handlerModule/handlerModule.js b/src/modules/handlerModule/handlerModule.js
index 3ad35d2..fc791be 100644
--- a/src/modules/handlerModule/handlerModule.js
+++ b/src/modules/handlerModule/handlerModule.js
@@ -132,4 +132,24 @@ module.exports = {
       }
     })();
   },
+  
+  cleanCommands: async function (client) {
+    const commandsArray = client.commands.map((data, name) => {
+      return name
+    })
+    
+
+    const registeredCommands = await client.application.commands.fetch()
+
+    for (const registeredCommand of registeredCommands) {
+      const name = registeredCommand[1].name
+      if (!commandsArray.includes(name)) {
+
+        // Command is registered but no longer exists in the bot - delete it!
+        client.application.commands.delete(registeredCommand[0])
+          .then(console.log(`/${name} has been deleted globally since it's no longer existing`))
+          .catch(console.error);
+      }
+    }
+  }
 };

From f929919cae9ebcd0c91d0381a96cb30e158c0003 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Thu, 17 Feb 2022 10:55:08 +0100
Subject: [PATCH 22/29] Updated version in package.json

---
 package.json | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/package.json b/package.json
index 37373d5..2c90787 100644
--- a/package.json
+++ b/package.json
@@ -1,6 +1,6 @@
 {
   "name": "golden",
-  "version": "4.2.0",
+  "version": "4.3.0",
   "description": "A Premium Discord Bot with a lot of functions and wihtout any Paywalls!",
   "main": "./src/golden.js",
   "scripts": {

From 32f9ec7e81f715ebea7616a3b0d72cf84fe91b58 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Thu, 17 Feb 2022 10:55:38 +0100
Subject: [PATCH 23/29] Updated copyright in README.md

---
 README.md | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/README.md b/README.md
index 78a8a05..fb813d5 100644
--- a/README.md
+++ b/README.md
@@ -28,7 +28,7 @@
 <br/>
 <br/>
   <div align="center">
-    ™ and © 2021 The Golden Authors. All Rights Reserved.
+    ™ and © 2022 The Golden Authors. All Rights Reserved.
     </div>
   <div align="center">
   <br/>

From 34c75cd5c3fc561855f37e6b49e1677c68616d9e Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Thu, 17 Feb 2022 10:59:28 +0100
Subject: [PATCH 24/29] Guild name was not added to the database correctly

---
 src/commands/music/setup.js                  |  4 +--
 src/events/generic/interactionCreate.js      |  4 +--
 src/modules/databaseModule/databaseModule.js | 29 ++++++++++++++++----
 3 files changed, 28 insertions(+), 9 deletions(-)

diff --git a/src/commands/music/setup.js b/src/commands/music/setup.js
index 4172e53..ceb07c1 100644
--- a/src/commands/music/setup.js
+++ b/src/commands/music/setup.js
@@ -48,8 +48,8 @@ module.exports = {
     const channel = await createChannel(interaction.guild);
     await setGuildChannel(interaction.guild.id, channel.id, interaction.guild.name);
     const { channelHero, channelEmbed } = await populateChannel(interaction.guild);
-    await setGuildChannelEmbed(interaction.guild.id, channelEmbed.id);
-    await setGuildChannelHero(interaction.guild.id, channelHero.id);
+    await setGuildChannelEmbed(interaction.guild.id, channelEmbed.id, interaction.guild.name);
+    await setGuildChannelHero(interaction.guild.id, channelHero.id, interaction.guild.name);
 
     client.manager.players.filter(async player =>
     {
diff --git a/src/events/generic/interactionCreate.js b/src/events/generic/interactionCreate.js
index fcd96f9..5d33ad6 100644
--- a/src/events/generic/interactionCreate.js
+++ b/src/events/generic/interactionCreate.js
@@ -48,8 +48,8 @@ module.exports = {
           await setGuildChannel(interaction.guild.id, channel.id, interaction.guild.name);
           const { channelHero, channelEmbed } = await populateChannel(interaction.guild);
           if(channelHero && channelEmbed === undefined) return interaction.deferUpdate();
-          setGuildChannelEmbed(interaction.guild.id, channelEmbed.id);
-          setGuildChannelHero(interaction.guild.id, channelHero.id);
+          setGuildChannelEmbed(interaction.guild.id, channelEmbed.id, interaction.guild.name);
+          setGuildChannelHero(interaction.guild.id, channelHero.id, interaction.guild.name);
 
           client.manager.players.filter(async (player) => {
             if (player.guild !== interaction.guild.id) return;
diff --git a/src/modules/databaseModule/databaseModule.js b/src/modules/databaseModule/databaseModule.js
index 0419c9e..06c1cfb 100644
--- a/src/modules/databaseModule/databaseModule.js
+++ b/src/modules/databaseModule/databaseModule.js
@@ -45,10 +45,6 @@ module.exports = {
     }
   },
 
-  addGuildIfNotExists: async function (guildId, guildName) {
-    if (!await module.exports.guildExists(guildId)) await module.exports.addGuild(guildId, guildName)
-  },
-
   addGuild: async function (guildId, guildName) {
     if (guildName === undefined) guildName = "Unknown";
     let conn;
@@ -66,6 +62,25 @@ module.exports = {
     }
   },
 
+  updateGuild: async function (guildId, guildName) {
+    console.log(guildName)
+    if (guildName === undefined) guildName = "Unknown";
+    let conn;
+    try {
+      conn = await pool.getConnection();
+      await conn.query(`UPDATE guilds\
+                                      SET guildName = '${guildName}'\
+                                      WHERE guildId = '${guildId}'\
+                                    ;`, [1, "mariadb"]);
+
+    } catch (err) {
+      console.log(err)
+      throw err;
+    } finally {
+      if (conn) return conn.end();
+    }
+  },
+
   getAllGuilds: async function () {
     let conn;
     try {
@@ -112,7 +127,11 @@ module.exports = {
   },
 
   addGuildIfNotExists: async function (guildId, guildName) {
-    if (!await module.exports.guildExists(guildId)) await module.exports.addGuild(guildId, guildName);
+    if (!await module.exports.guildExists(guildId)) {
+     await module.exports.addGuild(guildId, guildName);
+    } else {
+      await module.exports.updateGuild(guildId, guildName);
+    }
   },
 
 

From 2b3dd454bba5e303179a2f035d2433b297b096b1 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Fri, 18 Feb 2022 14:58:26 +0100
Subject: [PATCH 25/29] Switched Spotify plugin

---
 package.json  |  2 +-
 src/golden.js |  2 +-
 yarn.lock     | 31 ++++++++++++-------------------
 3 files changed, 14 insertions(+), 21 deletions(-)

diff --git a/package.json b/package.json
index 2c90787..a5aaca9 100644
--- a/package.json
+++ b/package.json
@@ -11,6 +11,7 @@
   "dependencies": {
     "@discordjs/builders": "^0.9.0",
     "@discordjs/rest": "^0.1.0-canary.0",
+    "better-erela.js-spotify": "^1.3.6",
     "better-uptime": "^1.1.4",
     "check-links": "^1.1.8",
     "console-stamp": "^3.0.3",
@@ -18,7 +19,6 @@
     "discord-together": "^1.3.25",
     "discord.js": "^13.3.1",
     "dotenv": "^10.0.0",
-    "erela.js-spotify": "^1.2.0",
     "erela.js-vk": "^2.3.3-vk-8",
     "format-duration": "^1.4.0",
     "mariadb": "^2.5.5"
diff --git a/src/golden.js b/src/golden.js
index 17446ed..7a1ab0c 100644
--- a/src/golden.js
+++ b/src/golden.js
@@ -1,6 +1,6 @@
 const env = require("dotenv").config({ path: "./data/config.env" });
 
-const Spotify = require("erela.js-spotify");
+const Spotify = require("better-erela.js-spotify").default;
 const { Client, Intents } = require("discord.js");
 const { Manager } = require("erela.js");
 const { DiscordTogether } = require('discord-together');
diff --git a/yarn.lock b/yarn.lock
index 7fba565..7e4b984 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -134,12 +134,13 @@ asynckit@^0.4.0:
   resolved "https://registry.yarnpkg.com/asynckit/-/asynckit-0.4.0.tgz#c79ed97f7f34cb8f2ba1bc9790bcc366474b4b79"
   integrity sha1-x57Zf380y48robyXkLzDZkdLS3k=
 
-axios@^0.20.0:
-  version "0.20.0"
-  resolved "https://registry.yarnpkg.com/axios/-/axios-0.20.0.tgz#057ba30f04884694993a8cd07fa394cff11c50bd"
-  integrity sha512-ANA4rr2BDcmmAQLOKft2fufrtuvlqR+cXNNinUmvfeSNCOF98PZL+7M/v1zIdGo7OLjEA9J2gXJL+j4zGsl0bA==
+better-erela.js-spotify@^1.3.6:
+  version "1.3.6"
+  resolved "https://registry.yarnpkg.com/better-erela.js-spotify/-/better-erela.js-spotify-1.3.6.tgz#baa3455cee926dfb3579d19e1fa7f1e2e1b071b4"
+  integrity sha512-W7XoYVsz3thOlHccj9rHjyZlcu9vVYmoH7JvtxZ8e8tKJN8xoYeY4Zp9UBFUClunZkpXM9i/HBfVx1m6sPojCw==
   dependencies:
-    follow-redirects "^1.10.0"
+    erela.js "^2.3.3"
+    undici "^4.13.0"
 
 better-uptime@^1.1.4:
   version "1.1.4"
@@ -301,14 +302,6 @@ end-of-stream@^1.1.0:
   dependencies:
     once "^1.4.0"
 
-erela.js-spotify@^1.2.0:
-  version "1.2.0"
-  resolved "https://registry.yarnpkg.com/erela.js-spotify/-/erela.js-spotify-1.2.0.tgz#ebbcbfde1e0eb8593d418ed9c578d758aad04701"
-  integrity sha512-FbkdVK7OquVzyNVl4aZ3AU6RHRrHzBpORGorK5q+L26y3hB/7ze9mQ7uiOa5PsskskELRWepoluqke3U8edbmQ==
-  dependencies:
-    axios "^0.20.0"
-    erela.js "^2.2.0"
-
 erela.js-vk@^2.3.3-vk-8:
   version "2.3.3-vk-8"
   resolved "https://registry.yarnpkg.com/erela.js-vk/-/erela.js-vk-2.3.3-vk-8.tgz#c1f7ea289aba0be93b08452ae1806c97b8a3bd0d"
@@ -318,7 +311,7 @@ erela.js-vk@^2.3.3-vk-8:
     petitio "^1.3.2"
     ws "^8.1.0"
 
-erela.js@^2.2.0:
+erela.js@^2.3.3:
   version "2.3.3"
   resolved "https://registry.yarnpkg.com/erela.js/-/erela.js-2.3.3.tgz#22b43e29315c2fcdc8e070beda93eb3f34405c16"
   integrity sha512-tzowGHLSodZr2j311csFSqm9lwE6plqeULTAwPwuRX9PQbXg4Ohdy/3MTMWrltiFAMSIG/5r9GQtTUt9Mqzhhw==
@@ -332,11 +325,6 @@ event-target-shim@^5.0.0:
   resolved "https://registry.yarnpkg.com/event-target-shim/-/event-target-shim-5.0.1.tgz#5d4d3ebdf9583d63a5333ce2deb7480ab2b05789"
   integrity sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==
 
-follow-redirects@^1.10.0:
-  version "1.14.7"
-  resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.14.7.tgz#2004c02eb9436eee9a21446a6477debf17e81685"
-  integrity sha512-+hbxoLbFMbRKDwohX8GkTataGqO6Jb7jGwpAlwgy2bIz25XtRm7KEzJM76R1WiNT5SwZkX4Y75SwBolkpmE7iQ==
-
 form-data@^3.0.0:
   version "3.0.1"
   resolved "https://registry.yarnpkg.com/form-data/-/form-data-3.0.1.tgz#ebd53791b78356a99af9a300d4282c4d5eb9755f"
@@ -644,6 +632,11 @@ tslib@^2.3.0, tslib@^2.3.1:
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01"
   integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==
 
+undici@^4.13.0:
+  version "4.14.1"
+  resolved "https://registry.yarnpkg.com/undici/-/undici-4.14.1.tgz#7633b143a8a10d6d63335e00511d071e8d52a1d9"
+  integrity sha512-WJ+g+XqiZcATcBaUeluCajqy4pEDcQfK1vy+Fo+bC4/mqXI9IIQD/XWHLS70fkGUT6P52Drm7IFslO651OdLPQ==
+
 url-parse-lax@^3.0.0:
   version "3.0.0"
   resolved "https://registry.yarnpkg.com/url-parse-lax/-/url-parse-lax-3.0.0.tgz#16b5cafc07dbe3676c1b1999177823d6503acb0c"

From 5e1c3ea2c0ec5d05cc1d6f397902ae07d01474e7 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Fri, 18 Feb 2022 14:59:09 +0100
Subject: [PATCH 26/29] Fixed track resolving

---
 src/commands/music/nowplaying.js                   | 1 +
 src/modules/channelModule/channelModule.js         | 1 +
 src/modules/musicPlayerModule/musicPlayerModule.js | 5 ++---
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/commands/music/nowplaying.js b/src/commands/music/nowplaying.js
index 09e5257..8c0d815 100644
--- a/src/commands/music/nowplaying.js
+++ b/src/commands/music/nowplaying.js
@@ -55,6 +55,7 @@ async function NPEmbed(interaction, player)
 				.setURL('https://www.youtube.com/watch?v=' + queue.current.identifier)
 		);
 
+	if (typeof queue.current.resolve == 'function') await queue.current.resolve();
 	await replyBtnInteractionEmbed(interaction, '', `<:musicnote:930887306045435934> **Now Playing:** [${queue.current.title} by ${queue.current.author}](${queue.current.uri})\n**Duration:** ${bar} ${formatDuration(player.position)}|${formatDuration(queue.current.duration)}\n**Requested by:** ${queue.current.requester}`, `DARK_GREEN`, queue.current.displayThumbnail("mqdefault"), channelControlComponent);
 
 	const Interval = setInterval(() =>
diff --git a/src/modules/channelModule/channelModule.js b/src/modules/channelModule/channelModule.js
index d664a7d..827524a 100644
--- a/src/modules/channelModule/channelModule.js
+++ b/src/modules/channelModule/channelModule.js
@@ -169,6 +169,7 @@ module.exports = {
 				// if there's no thumbnail (e.g. SoundCloud or radio link)
 				channelEmbed.embeds[0].image.url = process.env.GOLDEN_EMBED_THUMBNAIL;
 			} else {
+				if (typeof player.queue.current.resolve == 'function') await player.queue.current.resolve();
 				let trackThumbnail = await player.queue.current.displayThumbnail(
 					'maxresdefault'
 				);
diff --git a/src/modules/musicPlayerModule/musicPlayerModule.js b/src/modules/musicPlayerModule/musicPlayerModule.js
index 519fe41..8b92684 100644
--- a/src/modules/musicPlayerModule/musicPlayerModule.js
+++ b/src/modules/musicPlayerModule/musicPlayerModule.js
@@ -1,5 +1,5 @@
 const format = require('format-duration');
-const { setEmbed, generateQueue } = require('../channelModule/channelModule');
+const { setEmbed } = require('../channelModule/channelModule');
 
 module.exports = {
   trackLoaded: async function (guild, player, track) {
@@ -10,8 +10,7 @@ module.exports = {
     if (player.queue.length >= 1) {
       setEmbed(guild, player);
     } else {
-      if (track.thumbail === undefined && track.resolve !== undefined)
-        await track.resolve("thumbnail"); // fetch thumbnail
+      if (typeof track.resolve == 'function') await track.resolve();
         setEmbed(guild, player);
     }
   },

From 42ac2b2cd6ee9020d21351f7a726033c3e1fe3f3 Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Fri, 18 Feb 2022 15:00:22 +0100
Subject: [PATCH 27/29] Prevented unsupported Spotify playback

---
 src/modules/databaseModule/databaseModule.js | 1 -
 1 file changed, 1 deletion(-)

diff --git a/src/modules/databaseModule/databaseModule.js b/src/modules/databaseModule/databaseModule.js
index 06c1cfb..1b3f6fd 100644
--- a/src/modules/databaseModule/databaseModule.js
+++ b/src/modules/databaseModule/databaseModule.js
@@ -63,7 +63,6 @@ module.exports = {
   },
 
   updateGuild: async function (guildId, guildName) {
-    console.log(guildName)
     if (guildName === undefined) guildName = "Unknown";
     let conn;
     try {

From 98cae365d4d2394218e39f1176ab66fce63e7a8c Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Fri, 18 Feb 2022 15:00:35 +0100
Subject: [PATCH 28/29] Clean up

---
 src/modules/musicControllerModule/musicControllerModule.js | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/modules/musicControllerModule/musicControllerModule.js b/src/modules/musicControllerModule/musicControllerModule.js
index 64a5dec..9ffd628 100644
--- a/src/modules/musicControllerModule/musicControllerModule.js
+++ b/src/modules/musicControllerModule/musicControllerModule.js
@@ -85,6 +85,9 @@ module.exports = {
     if (voiceChannel.id !== player.voiceChannel) 
       return sendTemporaryMessage(channel, { embeds: [createEmbed('', 'I\'ve to be in the same voice channel with you for requesting tracks.', 'DARK_RED')] }, 10000);
 
+    if (content.includes('https://open.spotify.com/episode') || content.includes('https://open.spotify.com/show'))
+      return sendTemporaryMessage(channel, { embeds: [createEmbed('', 'I don\'t support podcasts from Spotify for now, please use another source.', 'DARK_RED')] }, 10000);
+
     if (player.state !== "CONNECTED") player.connect();
 
     const search = content;

From 29384d1ec5bebfbf64e9fdcd686c7a6cbd4da5fe Mon Sep 17 00:00:00 2001
From: Anweisung <xd98474@gmail.com>
Date: Fri, 18 Feb 2022 23:11:45 +0100
Subject: [PATCH 29/29] Fixed Better Uptime crash

---
 src/events/generic/ready.js | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/events/generic/ready.js b/src/events/generic/ready.js
index 47f71c9..715074e 100644
--- a/src/events/generic/ready.js
+++ b/src/events/generic/ready.js
@@ -49,8 +49,8 @@ module.exports = {
 
         if (process.env.BETTERUPTIME_ENABLED === 'true')
             new Uptime({
-                url: process.env.BETTERUPTIME_URL,
-                time: process.env.BETTERUPTIME_TIME,
+                url: process.env.BETTERUPTIME_HEARTBEAT_URL,
+                time: Number(process.env.BETTERUPTIME_TIME),
                 time_type: process.env.BETTERUPTIME_TIME_TYPE, //millisecond, minute, hour, day, week
             });