Add customizable Bot status (#599)

Co-authored-by: Max Isom <codetheweb@users.noreply.github.com>
Co-authored-by: Max Isom <hi@maxisom.me>
This commit is contained in:
Zagrthos 2022-03-25 00:19:48 +01:00 committed by GitHub
parent cf49053370
commit 2f9382f517
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 67 additions and 2 deletions

View file

@ -17,6 +17,10 @@ const CONFIG_MAP = {
DATA_DIR,
CACHE_DIR: path.join(DATA_DIR, 'cache'),
CACHE_LIMIT_IN_BYTES: xbytes.parseSize(process.env.CACHE_LIMIT ?? '2GB'),
BOT_STATUS: process.env.BOT_STATUS ?? 'online',
BOT_ACTIVITY_TYPE: process.env.BOT_ACTIVITY_TYPE ?? 'LISTENING',
BOT_ACTIVITY_URL: process.env.BOT_ACTIVITY_URL ?? '',
BOT_ACTIVITY: process.env.BOT_ACTIVITY ?? 'music',
} as const;
@injectable()
@ -29,6 +33,10 @@ export default class Config {
readonly DATA_DIR!: string;
readonly CACHE_DIR!: string;
readonly CACHE_LIMIT_IN_BYTES!: number;
readonly BOT_STATUS!: string;
readonly BOT_ACTIVITY_TYPE!: string;
readonly BOT_ACTIVITY_URL!: string;
readonly BOT_ACTIVITY!: string;
constructor() {
for (const [key, value] of Object.entries(CONFIG_MAP)) {