Use fetch instead of cache when possible

This commit is contained in:
Dragon Fire
2020-06-07 16:49:26 -04:00
parent f5b56ace59
commit 14396092f1
4 changed files with 5 additions and 4 deletions
+1 -1
View File
@@ -65,7 +65,7 @@ module.exports = class GuesspionageCommand extends Command {
pts.set(player, {
points: 0,
id: player,
user: this.client.users.cache.get(player)
user: await this.client.users.fetch(player)
});
}
const used = [];
+1 -1
View File
@@ -52,7 +52,7 @@ module.exports = class LieSwatterCommand extends Command {
pts.set(player, {
points: 0,
id: player,
user: this.client.users.cache.get(player)
user: await this.client.users.fetch(player)
});
}
const questions = await this.fetchQuestions();
+2 -1
View File
@@ -20,7 +20,7 @@ module.exports = class ClocCommand extends Command {
}
async run(msg) {
const cloc = this.cache || await this.cloc();
const cloc = await this.cloc();
const embed = new MessageEmbed()
.setColor(0x00AE86)
.setFooter(`${cloc.header.cloc_url} ${cloc.header.cloc_version}`)
@@ -34,6 +34,7 @@ module.exports = class ClocCommand extends Command {
}
async cloc() {
if (this.cache) return this.cache;
const { stdout, stderr } = await exec(
path.join(__dirname, '..', '..', 'node_modules', '.bin', 'cloc'),
['--json', '--exclude-dir=node_modules', path.join(__dirname, '..', '..')]
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "116.2.2",
"version": "116.2.3",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {