mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Use fetch instead of cache when possible
This commit is contained in:
@@ -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 = [];
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "116.2.2",
|
||||
"version": "116.2.3",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user