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);
// 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
+2
View File
@@ -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);
}