muse/src/index.ts

16 lines
390 B
TypeScript
Raw Normal View History

2020-03-13 04:41:26 +01:00
import container from './inversify.config';
import Spotify from 'spotify-web-api-node';
import {TYPES} from './types';
import Bot from './bot';
2020-03-09 17:57:39 +01:00
2020-03-13 04:41:26 +01:00
let bot = container.get<Bot>(TYPES.Bot);
const spotify = container.get<Spotify>(TYPES.Lib.Spotify);
2020-03-09 17:57:39 +01:00
2020-03-13 04:41:26 +01:00
(async () => {
const auth = await spotify.clientCredentialsGrant();
2020-03-09 17:57:39 +01:00
2020-03-13 04:41:26 +01:00
spotify.setAccessToken(auth.body.access_token);
2020-03-09 17:57:39 +01:00
2020-03-13 04:41:26 +01:00
bot.listen();
})();