Add SponsorBlock support (#1013)

This commit is contained in:
Charlignon 2024-04-28 23:13:25 +02:00 committed by GitHub
parent 8e08919206
commit a27598c50a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 379 additions and 344 deletions

View file

@ -22,6 +22,8 @@ const CONFIG_MAP = {
BOT_ACTIVITY_TYPE: process.env.BOT_ACTIVITY_TYPE ?? 'LISTENING',
BOT_ACTIVITY_URL: process.env.BOT_ACTIVITY_URL ?? '',
BOT_ACTIVITY: process.env.BOT_ACTIVITY ?? 'music',
ENABLE_SPONSORBLOCK: process.env.ENABLE_SPONSORBLOCK === 'true',
SPONSORBLOCK_TIMEOUT: process.env.ENABLE_SPONSORBLOCK ?? 5,
} as const;
const BOT_ACTIVITY_TYPE_MAP = {
@ -45,6 +47,8 @@ export default class Config {
readonly BOT_ACTIVITY_TYPE!: Exclude<ActivityType, ActivityType.Custom>;
readonly BOT_ACTIVITY_URL!: string;
readonly BOT_ACTIVITY!: string;
readonly ENABLE_SPONSORBLOCK!: boolean;
readonly SPONSORBLOCK_TIMEOUT!: number;
constructor() {
for (const [key, value] of Object.entries(CONFIG_MAP)) {