mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 15:07:42 +02:00
Fix lint
This commit is contained in:
@@ -28,7 +28,6 @@ module.exports = class AvatarChanger {
|
|||||||
this.isWearingHat = true;
|
this.isWearingHat = 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);
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
setInterval() {
|
setInterval() {
|
||||||
@@ -37,14 +36,14 @@ module.exports = class AvatarChanger {
|
|||||||
now.getUTCFullYear(),
|
now.getUTCFullYear(),
|
||||||
now.getUTCMonth(),
|
now.getUTCMonth(),
|
||||||
now.getUTCDate() + 1,
|
now.getUTCDate() + 1,
|
||||||
0 ,0, 0, 0
|
0, 0, 0, 0
|
||||||
));
|
));
|
||||||
const msUntilNext = midnight - now;
|
const msUntilNext = midnight - now;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const holiday = this.isHoliday(today);
|
const holiday = this.isHoliday(today);
|
||||||
if (holiday) {
|
if (holiday) {
|
||||||
let hat = holiday.hat;
|
let { hat } = holiday;
|
||||||
if (Array.isArray(hat)) hat = hat[Math.floor(Math.random() * hat.length)];
|
if (Array.isArray(hat)) hat = hat[Math.floor(Math.random() * hat.length)];
|
||||||
this.setAvatar(hat)
|
this.setAvatar(hat)
|
||||||
.then(() => this.client.logger.info(`[AVATAR] Updated avatar to ${hat}!`))
|
.then(() => this.client.logger.info(`[AVATAR] Updated avatar to ${hat}!`))
|
||||||
@@ -73,10 +72,10 @@ module.exports = class AvatarChanger {
|
|||||||
isThanksgiving(day) {
|
isThanksgiving(day) {
|
||||||
const thanksgiving = this.getThanksgiving(day.getUTCFullYear());
|
const thanksgiving = this.getThanksgiving(day.getUTCFullYear());
|
||||||
return (
|
return (
|
||||||
day.getUTCFullYear() === thanksgiving.getUTCFullYear() &&
|
day.getUTCFullYear() === thanksgiving.getUTCFullYear()
|
||||||
day.getUTCMonth() === thanksgiving.getUTCMonth() &&
|
&& day.getUTCMonth() === thanksgiving.getUTCMonth()
|
||||||
day.getUTCDate() === thanksgiving.getUTCDate()
|
&& day.getUTCDate() === thanksgiving.getUTCDate()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
getThanksgiving(year) {
|
getThanksgiving(year) {
|
||||||
|
|||||||
Reference in New Issue
Block a user