Compare commits
3 Commits
2456034726
...
3182903c77
Author | SHA1 | Date |
---|---|---|
Kit Kasune | 3182903c77 | 2 years ago |
Kit Kasune | 53a3e5c839 | 2 years ago |
Kit Kasune | afcbf5ba07 | 2 years ago |
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,19 @@ |
||||
const chalk = require('chalk'); |
||||
|
||||
const ora = require('../../../util/log/ora'); |
||||
|
||||
module.exports = async (client) => { |
||||
const t = Date.now(); |
||||
client.misc = {}; |
||||
client.misc.dscconnected = false; |
||||
|
||||
await ora(`Waking up Natsuki... ${chalk.blueBright.bold.underline("(Connecting to Discord...)")}`, |
||||
client.login(client.auth.token) |
||||
).catch((e) => client.error("Failed to connect to Discord!! Error below.", 0, true, true, e)) |
||||
.then(() => {client.misc.dscconnected = true;}); |
||||
if (!client.misc.dscconnected) { |
||||
client.warn("Discord not connected, considering runtime to be unusable and exiting.", 0, true, true); |
||||
throw new Error(); |
||||
} |
||||
return client.success(`Connected to Discord in ${chalk.white(`${Date.now() - t}ms`)}.`); |
||||
}; |
Loading…
Reference in new issue