[READ-ONLY] Mirror of https://github.com/maybeanerd/MagiBot. MagiBot - the community building discord bot that adds joinsounds to your voice channels! discord.gg/2Evcf4T
bot bots community discord gaming hacktoberfest sound
1

Configure Feed

Select the types of activity you want to include in your feed.

fix some things

Sebastian Di Luzio (Apr 7, 2022, 8:27 PM +0200) b60a06bb 8e79c613

+6 -6
+4 -4
src/db.ts
··· 152 152 let latestTimePassed = 0; 153 153 await asyncForEach(guilds, async (G) => { 154 154 const guildID = G.id; 155 + const localCounter = ++counter; 155 156 await checkGuild(guildID); 156 157 // update the guild settings entry so that it does NOT get deleted 157 158 await db ··· 185 186 } 186 187 }); 187 188 // update percentage message 188 - counter++; 189 189 if (msg) { 190 190 const u = process.hrtime(t0); 191 - if (u[0] - latestTimePassed > 0 || counter === guilds.length) { 191 + if (u[0] - latestTimePassed > 0 || localCounter === guilds.length) { 192 192 // eslint-disable-next-line prefer-destructuring 193 - latestTimePassed = u[0] + 250; // add a minimum of 250ms delay between message updates 194 - const percentage = Math.round((counter / guilds.length) * 100); 193 + latestTimePassed = u[0]; // add a minimum of 1s delay between message updates 194 + const percentage = Math.round((localCounter / guilds.length) * 100); 195 195 let uptime = ''; 196 196 // mins 197 197 let x = Math.floor(u[0] / 60);
src/rename-me.botlistTokens.json rename-me.botlistTokens.json
+2 -2
src/token.ts
··· 11 11 }; 12 12 13 13 try { 14 - // eslint-disable-next-line global-require 15 - blapis = require('./botlistTokens.json'); 14 + // eslint-disable-next-line import/no-dynamic-require, global-require 15 + blapis = require(`${__dirname}/../botlistTokens.json`); 16 16 } catch (e) { 17 17 // eslint-disable-next-line no-console 18 18 console.warn('no bot list tokens found, defaulting to none');