diff options
| author | Peerawas Archavanuntakun <[email protected]> | 2022-01-06 03:30:32 +0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-05 14:30:32 -0600 |
| commit | 51d378e4cb4584196b14132b4d330b8d370f8fb3 (patch) | |
| tree | 176959c304bcb28ef33df0a3546bb4b88d691b09 /src/index.ts | |
| parent | 129d121364c7e976c7bf5e2da3976da230058d77 (diff) | |
| download | muse-51d378e4cb4584196b14132b4d330b8d370f8fb3.tar.xz muse-51d378e4cb4584196b14132b4d330b8d370f8fb3.zip | |
Setup and migrate to Prisma (#456)
Diffstat (limited to 'src/index.ts')
| -rw-r--r-- | src/index.ts | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/src/index.ts b/src/index.ts index a6b6d35..e6df09d 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,28 +1,14 @@ import makeDir from 'make-dir'; import path from 'path'; -import {makeLines} from 'nodesplash'; import container from './inversify.config.js'; import {TYPES} from './types.js'; import Bot from './bot.js'; -import {sequelize} from './utils/db.js'; import Config from './services/config.js'; import FileCacheProvider from './services/file-cache.js'; -import metadata from '../package.json'; const bot = container.get<Bot>(TYPES.Bot); -(async () => { - // Banner - console.log(makeLines({ - user: 'codetheweb', - repository: 'muse', - version: metadata.version, - paypalUser: 'codetheweb', - githubSponsor: 'codetheweb', - madeByPrefix: 'Made with 🎶 by ', - }).join('\n')); - console.log('\n'); - +const startBot = async () => { // Create data directories if necessary const config = container.get<Config>(TYPES.Config); @@ -30,9 +16,9 @@ const bot = container.get<Bot>(TYPES.Bot); await makeDir(config.CACHE_DIR); await makeDir(path.join(config.CACHE_DIR, 'tmp')); - await sequelize.sync({alter: true}); - await container.get<FileCacheProvider>(TYPES.FileCache).cleanup(); await bot.listen(); -})(); +}; + +export {startBot}; |
