mirror of
https://github.com/BluemediaDev/muse.git
synced 2025-08-05 23:43:30 +02:00
feat: allow running without spotify
This commit is contained in:
parent
534d8fafaa
commit
af639159d1
7 changed files with 158 additions and 124 deletions
|
@ -1,7 +1,7 @@
|
|||
import {AutocompleteInteraction, ChatInputCommandInteraction} from 'discord.js';
|
||||
import {URL} from 'url';
|
||||
import {SlashCommandBuilder} from '@discordjs/builders';
|
||||
import {inject, injectable} from 'inversify';
|
||||
import {inject, injectable, optional} from 'inversify';
|
||||
import Spotify from 'spotify-web-api-node';
|
||||
import Command from './index.js';
|
||||
import {TYPES} from '../types.js';
|
||||
|
@ -36,12 +36,12 @@ export default class implements Command {
|
|||
|
||||
public requiresVC = true;
|
||||
|
||||
private readonly spotify: Spotify;
|
||||
private readonly spotify?: Spotify;
|
||||
private readonly cache: KeyValueCacheProvider;
|
||||
private readonly addQueryToQueue: AddQueryToQueue;
|
||||
|
||||
constructor(@inject(TYPES.ThirdParty) thirdParty: ThirdParty, @inject(TYPES.KeyValueCache) cache: KeyValueCacheProvider, @inject(TYPES.Services.AddQueryToQueue) addQueryToQueue: AddQueryToQueue) {
|
||||
this.spotify = thirdParty.spotify;
|
||||
constructor(@inject(TYPES.ThirdParty) @optional() thirdParty: ThirdParty, @inject(TYPES.KeyValueCache) cache: KeyValueCacheProvider, @inject(TYPES.Services.AddQueryToQueue) addQueryToQueue: AddQueryToQueue) {
|
||||
this.spotify = thirdParty?.spotify;
|
||||
this.cache = cache;
|
||||
this.addQueryToQueue = addQueryToQueue;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue