diff options
| author | Max Isom <[email protected]> | 2021-12-13 20:11:14 -0500 |
|---|---|---|
| committer | Max Isom <[email protected]> | 2021-12-13 20:11:14 -0500 |
| commit | ffc8493ea3816402f142794cc7904244e9f6e2ac (patch) | |
| tree | 16e08654d56dba4517720033686d514dbf92dfad /src | |
| parent | fa4ba0bb9acd1c5208c1ff844823706b26f56165 (diff) | |
| download | muse-ffc8493ea3816402f142794cc7904244e9f6e2ac.tar.xz muse-ffc8493ea3816402f142794cc7904244e9f6e2ac.zip | |
Add splash banner and spinner progress for initial connection
Diffstat (limited to 'src')
| -rw-r--r-- | src/bot.ts | 8 | ||||
| -rw-r--r-- | src/index.ts | 13 |
2 files changed, 19 insertions, 2 deletions
@@ -1,5 +1,6 @@ import {Client, Message, Collection} from 'discord.js'; import {inject, injectable} from 'inversify'; +import ora from 'ora'; import {TYPES} from './types.js'; import {Settings, Shortcut} from './models/index.js'; import container from './inversify.config.js'; @@ -96,9 +97,12 @@ export default class { } }); - this.client.on('ready', async () => { + const spinner = ora('📡 connecting to Discord...').start(); + + this.client.on('ready', () => { debug(generateDependencyReport()); - console.log(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.client.user?.id ?? ''}&scope=bot&permissions=36752448`); + + spinner.succeed(`Ready! Invite the bot with https://discordapp.com/oauth2/authorize?client_id=${this.client.user?.id ?? ''}&scope=bot&permissions=36752448`); }); this.client.on('error', console.error); diff --git a/src/index.ts b/src/index.ts index 383faef..a6b6d35 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,28 @@ 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'); + // Create data directories if necessary const config = container.get<Config>(TYPES.Config); |
