From e0af038f7abb7d7876611111b1e3a09fd6539386 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 13 Aug 2021 04:37:37 -0600 Subject: [PATCH] message channel reading bug and start timer --- bot.js | 2 +- events/messageCreate.js | 4 +--- events/ready.js | 2 +- package.json | 2 +- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/bot.js b/bot.js index 7f2e4e5..ef31b51 100644 --- a/bot.js +++ b/bot.js @@ -83,6 +83,6 @@ async function init() { client.guildconfig.logs = new Map(); - await require('./util/wait')(10000).then(async () => {if (!client.misc.readied) {await require('./events/ready')(client);}}); + await require('./util/wait')(5000).then(async () => {if (!client.misc.readied) {client.misc.forcedReady = true; await require('./events/ready')(client);}}); } init().then(() => {}); \ No newline at end of file diff --git a/events/messageCreate.js b/events/messageCreate.js index f70e423..d6bcbc2 100644 --- a/events/messageCreate.js +++ b/events/messageCreate.js @@ -8,7 +8,7 @@ const AR = require('../models/ar'); const LXP = require('../models/localxp'); const Monitors = require('../models/monitor'); -const channelTypes = ["GUILD_MESSAGE", "DM", "GUILD_NEWS_THREAD", "GUILD_PRIVATE_THREAD", "GUILD_PUBLIC_THREAD", "GUILD_NEWS", "GROUP_DM", "GUILD_STORE"]; +const channelTypes = ["GUILD_MESSAGE", "DM", "GUILD_NEWS_THREAD", "GUILD_PRIVATE_THREAD", "GUILD_PUBLIC_THREAD", "GUILD_NEWS", "GROUP_DM", "GUILD_STORE", "GUILD_TEXT"]; module.exports = async (client, message) => { if (message.author.bot) {return undefined;} @@ -90,8 +90,6 @@ module.exports = async (client, message) => { client.misc.cache.monit[message.guild.id].expiry.setTime(Date.now()); } - - try { if (msg.startsWith(prefix) || msg.startsWith(`<@${client.user.id}>`) || msg.startsWith(`<@!${client.user.id}>`)) { let command = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd)); diff --git a/events/ready.js b/events/ready.js index f051345..b6ee643 100644 --- a/events/ready.js +++ b/events/ready.js @@ -108,7 +108,7 @@ module.exports = async client => { console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`This is restart #${botData.restarts}.`)}`); let cms = new Date().getTime(); - console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`Startup completed in ${cms - client.misc.startup.getTime()}ms (${cms - client.misc.startupNoConnect.getTime()}ms post-connect).`)}`); + console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`Startup completed in ${cms - client.misc.startup.getTime() - client.misc.forcedReady ? 5000 : 0}ms (${cms - client.misc.startupNoConnect.getTime() - client.misc.forcedReady ? 5000 : 0}ms post-connect).`)}`); await botData.save(); }; \ No newline at end of file diff --git a/package.json b/package.json index 3eb777a..eb2a3d3 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ "ws": "^7.4.6" }, "engines": { - "node": "12.14.1" + "node": ">=16.0.0" }, "scripts": { "start": "run"