message channel reading bug and start timer

master
Kit Kasune 3 years ago
parent 573ed8d162
commit e0af038f7a
  1. 2
      bot.js
  2. 4
      events/messageCreate.js
  3. 2
      events/ready.js
  4. 2
      package.json

@ -83,6 +83,6 @@ async function init() {
client.guildconfig.logs = new Map(); 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(() => {}); init().then(() => {});

@ -8,7 +8,7 @@ const AR = require('../models/ar');
const LXP = require('../models/localxp'); const LXP = require('../models/localxp');
const Monitors = require('../models/monitor'); 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) => { module.exports = async (client, message) => {
if (message.author.bot) {return undefined;} 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()); client.misc.cache.monit[message.guild.id].expiry.setTime(Date.now());
} }
try { try {
if (msg.startsWith(prefix) || msg.startsWith(`<@${client.user.id}>`) || msg.startsWith(`<@!${client.user.id}>`)) { 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)); let command = client.commands.get(cmd) || client.commands.get(client.aliases.get(cmd));

@ -108,7 +108,7 @@ module.exports = async client => {
console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`This is restart #${botData.restarts}.`)}`); console.log(`${chalk.gray('\n[INFO]')} >> ${chalk.white(`This is restart #${botData.restarts}.`)}`);
let cms = new Date().getTime(); 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(); await botData.save();
}; };

@ -23,7 +23,7 @@
"ws": "^7.4.6" "ws": "^7.4.6"
}, },
"engines": { "engines": {
"node": "12.14.1" "node": ">=16.0.0"
}, },
"scripts": { "scripts": {
"start": "run" "start": "run"

Loading…
Cancel
Save