mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Redis isWearingHat
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user