Skip to content

Instantly share code, notes, and snippets.

@vikiboss
Last active April 6, 2023 08:30
Show Gist options
  • Save vikiboss/97ecdde593232bd95e8e79cdea7ead08 to your computer and use it in GitHub Desktop.
Save vikiboss/97ecdde593232bd95e8e79cdea7ead08 to your computer and use it in GitHub Desktop.
KiviBot
import sade from 'sade'
const kivi = sade('kivi')
kivi
.version('1.0.0')
.describe('cli for kivibot')
.option('-c, --config', 'Provide path to custom kivibot config', 'kivi.json')
kivi
.command('start')
.describe('start')
.example('start')
.action(opts => {
console.log('opts', opts)
})
kivi.parse(process.argv)
import degit from 'degit'
const repo = 'vikiboss/kivibot-plugin-template-ts'
const dg = degit(repo, { cache: true, force: true })
await dg.clone('./plugin/ts-demo')
import figlet from 'figlet'
import gradient from 'gradient-string'
const LOGO = figlet.textSync('KiviBot', { font: 'Colossal' }).trim()
console.log(LOGO)
// output:
// 888 d8P d8b d8b 888888b. 888
// 888 d8P Y8P Y8P 888 "88b 888
// 888 d8P 888 .88P 888
// 888d88K 888 888 888 888 8888888K. .d88b. 888888
// 8888888b 888 888 888 888 888 "Y88b d88""88b 888
// 888 Y88b 888 Y88 88P 888 888 888 888 888 888
// 888 Y88b 888 Y8bd8P 888 888 d88P Y88..88P Y88b.
// 888 Y88b 888 Y88P 888 8888888P" "Y88P" "Y888
console.log(gradient.rainbow.multiline(LOGO))
const duck = gradient.rainbow.multiline([' __', '<(o )___', ' ( ._> /', " `---'"].join('\n'))
console.log(duck)
console.log(gradient('blue', 'purple')('KiviBot'))
import ora from 'ora'
const loading = ora({
color: 'magenta',
spinner: {
interval: 50,
frames: ['◢', '◣', '◤', '◥']
}
})
loading.start("loading...")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment