From 8988c14579681446d67f7f2395e179e93d50cb05 Mon Sep 17 00:00:00 2001 From: lilyissillyyy Date: Tue, 17 Feb 2026 17:48:21 -0500 Subject: [PATCH] Redis isWearingHat --- Xiao.js | 2 ++ structures/AvatarChanger.js | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Xiao.js b/Xiao.js index e324766b..23e7c180 100644 --- a/Xiao.js +++ b/Xiao.js @@ -127,6 +127,8 @@ client.on('clientReady', async () => { }, 60000); // Interval to check for holidays and change the avatar if needed + const isWearingHat = await client.redis.db.get('hat'); + client.avatarChanger.isWearingHat = isWearingHat; client.avatarChanger.setInterval(); // Set up disabled commands diff --git a/structures/AvatarChanger.js b/structures/AvatarChanger.js index b459ed08..a43c2066 100644 --- a/structures/AvatarChanger.js +++ b/structures/AvatarChanger.js @@ -21,11 +21,13 @@ module.exports = class AvatarChanger { async setAvatar(hat) { if (!hat) { + await this.client.redis.db.set('hat', false); this.isWearingHat = false; await this.client.user.setAvatar(path.join(__dirname, '..', 'assets', 'images', 'Xiao.png')); return; } this.isWearingHat = true; + await this.client.redis.db.set('hat', true); const image = await this.editAvatar(hat); await this.client.user.setAvatar(image); }