From d71ccf98d6fb6c65234139f3b291911d620219e5 Mon Sep 17 00:00:00 2001 From: Jurien Hamaker Date: Tue, 20 Feb 2024 22:46:13 +0100 Subject: [PATCH] feat(Bots): Add ability to set avatar url manually --- apps/hoshi/src/events/app.events.ts | 9 +++++++++ apps/koto/src/events/app.events.ts | 9 +++++++++ apps/kusari/src/events/app.events.ts | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/apps/hoshi/src/events/app.events.ts b/apps/hoshi/src/events/app.events.ts index f027b6a..a8fb787 100644 --- a/apps/hoshi/src/events/app.events.ts +++ b/apps/hoshi/src/events/app.events.ts @@ -20,5 +20,14 @@ export class AppEvents { }, ], }); + + if (process.env['HOSHI_AVATAR_URL']) { + client.user + .setAvatar(process.env['HOSHI_AVATAR_URL']) + .then((u) => + this._logger.log(`Set client avatar to ${u.avatarURL()}`), + ) + .catch(() => this._logger.warn('Failed to set bot avatar')); + } } } diff --git a/apps/koto/src/events/app.events.ts b/apps/koto/src/events/app.events.ts index 7d34db2..cfb635f 100644 --- a/apps/koto/src/events/app.events.ts +++ b/apps/koto/src/events/app.events.ts @@ -20,5 +20,14 @@ export class AppEvents { }, ], }); + + if (process.env['KOTO_AVATAR_URL']) { + client.user + .setAvatar(process.env['KOTO_AVATAR_URL']) + .then((u) => + this._logger.log(`Set client avatar to ${u.avatarURL()}`), + ) + .catch(() => this._logger.warn('Failed to set bot avatar')); + } } } diff --git a/apps/kusari/src/events/app.events.ts b/apps/kusari/src/events/app.events.ts index 2db9447..5d36b2e 100644 --- a/apps/kusari/src/events/app.events.ts +++ b/apps/kusari/src/events/app.events.ts @@ -20,5 +20,14 @@ export class AppEvents { }, ], }); + + if (process.env['KUSARI_AVATAR_URL']) { + client.user + .setAvatar(process.env['KUSARI_AVATAR_URL']) + .then((u) => + this._logger.log(`Set client avatar to ${u.avatarURL()}`), + ) + .catch(() => this._logger.warn('Failed to set bot avatar')); + } } }