mirror of
https://github.com/BluemediaGER/muse.git
synced 2024-11-14 13:45:28 +01:00
56a469a999
Co-authored-by: Federico fuji97 Rapetti <fuji1097@gmail.com>
25 lines
680 B
TypeScript
25 lines
680 B
TypeScript
import makeDir from 'make-dir';
|
|
import path from 'path';
|
|
import container from './inversify.config.js';
|
|
import {TYPES} from './types.js';
|
|
import Bot from './bot.js';
|
|
import Config from './services/config.js';
|
|
import FileCacheProvider from './services/file-cache.js';
|
|
|
|
const bot = container.get<Bot>(TYPES.Bot);
|
|
|
|
const startBot = async () => {
|
|
// Create data directories if necessary
|
|
const config = container.get<Config>(TYPES.Config);
|
|
|
|
await makeDir(config.DATA_DIR);
|
|
await makeDir(config.CACHE_DIR);
|
|
await makeDir(path.join(config.CACHE_DIR, 'tmp'));
|
|
|
|
await container.get<FileCacheProvider>(TYPES.FileCache).cleanup();
|
|
|
|
await bot.register();
|
|
};
|
|
|
|
export {startBot};
|