-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
log.afterReady.native.ts
50 lines (42 loc) · 1.21 KB
/
log.afterReady.native.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// system file, please don't modify it
import figlet from "figlet"
import boxen from "boxen"
import util from "util"
import * as app from "#app"
import config from "#config"
import { filename } from "dirname-filename-esm"
const __filename = filename(import.meta)
export default new app.Listener({
event: "afterReady",
description: "Just log that bot is ready",
once: true,
async run() {
app.success(
`ok i'm ready! ${util.styleText(
"blue",
"My default prefix is",
)} ${util.styleText(["bold", "blueBright"], app.env.BOT_PREFIX)}`,
)
if (config.printNameOnReady)
figlet(app.packageJSON.name, (err, value) => {
if (err) return app.error(err, __filename, true)
if (!value)
return app.error("No value returned from figlet", __filename, true)
console.log(
boxen(util.styleText("blueBright", value), {
float: "center",
borderStyle: {
topLeft: " ",
topRight: " ",
bottomLeft: " ",
bottomRight: " ",
top: " ",
left: " ",
right: " ",
bottom: " ",
},
}),
)
})
},
})