diff options
Diffstat (limited to 'src/commands/play.ts')
| -rw-r--r-- | src/commands/play.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/commands/play.ts b/src/commands/play.ts index 25aef1c..7851eb7 100644 --- a/src/commands/play.ts +++ b/src/commands/play.ts @@ -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; } |
