Redis isWearingHat

This commit is contained in:
lilyissillyyy
2026-02-17 17:48:21 -05:00
parent d83a1fb2b9
commit 8988c14579
2 changed files with 4 additions and 0 deletions
+2
View File
@@ -127,6 +127,8 @@ client.on('clientReady', async () => {
}, 60000); }, 60000);
// Interval to check for holidays and change the avatar if needed // 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(); client.avatarChanger.setInterval();
// Set up disabled commands // Set up disabled commands
+2
View File
@@ -21,11 +21,13 @@ module.exports = class AvatarChanger {
async setAvatar(hat) { async setAvatar(hat) {
if (!hat) { if (!hat) {
await this.client.redis.db.set('hat', false);
this.isWearingHat = false; this.isWearingHat = false;
await this.client.user.setAvatar(path.join(__dirname, '..', 'assets', 'images', 'Xiao.png')); await this.client.user.setAvatar(path.join(__dirname, '..', 'assets', 'images', 'Xiao.png'));
return; return;
} }
this.isWearingHat = true; this.isWearingHat = true;
await this.client.redis.db.set('hat', true);
const image = await this.editAvatar(hat); const image = await this.editAvatar(hat);
await this.client.user.setAvatar(image); await this.client.user.setAvatar(image);
} }