import 'reflect-metadata'; import {Container} from 'inversify'; import {TYPES} from './types'; import Bot from './bot'; import {Client} from 'discord.js'; import YouTube from 'youtube.ts'; import Spotify from 'spotify-web-api-node'; import { DISCORD_TOKEN, DISCORD_CLIENT_ID, YOUTUBE_API_KEY, SPOTIFY_CLIENT_ID, SPOTIFY_CLIENT_SECRET, DATA_DIR, CACHE_DIR } from './utils/config'; // Managers import PlayerManager from './managers/player'; import QueueManager from './managers/queue'; // Comands import Command from './commands'; import Clear from './commands/clear'; import Config from './commands/config'; import ForwardSeek from './commands/fseek'; import Play from './commands/play'; import QueueCommad from './commands/queue'; import Seek from './commands/seek'; import Shuffle from './commands/shuffle'; import Skip from './commands/skip'; import Unskip from './commands/unskip'; let container = new Container(); // Bot container.bind(TYPES.Bot).to(Bot).inSingletonScope(); container.bind(TYPES.Client).toConstantValue(new Client()); // Managers container.bind(TYPES.Managers.Player).to(PlayerManager).inSingletonScope(); container.bind(TYPES.Managers.Queue).to(QueueManager).inSingletonScope(); // Commands container.bind(TYPES.Command).to(Clear).inSingletonScope(); container.bind(TYPES.Command).to(Config).inSingletonScope(); container.bind(TYPES.Command).to(ForwardSeek).inSingletonScope(); container.bind(TYPES.Command).to(Play).inSingletonScope(); container.bind(TYPES.Command).to(QueueCommad).inSingletonScope(); container.bind(TYPES.Command).to(Seek).inSingletonScope(); container.bind(TYPES.Command).to(Shuffle).inSingletonScope(); container.bind(TYPES.Command).to(Skip).inSingletonScope(); container.bind(TYPES.Command).to(Unskip).inSingletonScope(); // Config values container.bind(TYPES.Config.DISCORD_TOKEN).toConstantValue(DISCORD_TOKEN); container.bind(TYPES.Config.DISCORD_CLIENT_ID).toConstantValue(DISCORD_CLIENT_ID); container.bind(TYPES.Config.YOUTUBE_API_KEY).toConstantValue(YOUTUBE_API_KEY); container.bind(TYPES.Config.DATA_DIR).toConstantValue(DATA_DIR); container.bind(TYPES.Config.CACHE_DIR).toConstantValue(CACHE_DIR); // Static libraries container.bind(TYPES.Lib.YouTube).toConstantValue(new YouTube(YOUTUBE_API_KEY)); container.bind(TYPES.Lib.Spotify).toConstantValue(new Spotify({clientId: SPOTIFY_CLIENT_ID, clientSecret: SPOTIFY_CLIENT_SECRET})); export default container;