stupid hack to make dms work on gateway v8 until i can get an answer as to why private channels cache isnt populating :/

This commit is contained in:
Cynthia Foxwell 2021-07-23 22:48:43 -06:00
parent 6e536d850c
commit fa05d104d3
1 changed files with 6 additions and 1 deletions

View File

@ -53,7 +53,12 @@ for (const file of fs.readdirSync(resolve(__dirname, "modules"))) {
logger.info("hf:modules", "Loaded module: '%s'", file);
}
bot.on("messageCreate", CommandDispatcher);
bot.on("messageCreate", async (msg) => {
if (!(msg.channel instanceof Eris.Channel) && msg.author.id != bot.user.id) {
msg.channel = await bot.getDMChannel(msg.author.id);
}
await CommandDispatcher(msg);
});
bot.on("messageUpdate", (msg) => {
const oneDay = Date.now() - 86400000;
if (msg.timestamp > oneDay && !msg.hasRan) {