forked from jordbort/lemony-friend
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbot.js
More file actions
21 lines (15 loc) · 652 Bytes
/
bot.js
File metadata and controls
21 lines (15 loc) · 652 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
require(`dotenv`).config()
const fs = require(`fs/promises`)
fs.writeFile(`lemony_logs.txt`, `🍋️ LEMONY LOGS 🍋️\n`, (err) => {
if (err) { console.log(`Error writing logs:`, err) }
})
// Import helper functions
const { handleUncaughtException } = require("./utils")
// Import client
const client = require(`./client`)
process.on('uncaughtException', async (err) => {
const errorPosition = err.stack.split(`\n`)[1].split(`/`)[0].substring(4) + err.stack.split(`\n`)[1].split(`/`)[err.stack.split(`\n`)[1].split(`/`).length - 1]
await handleUncaughtException(client, err, errorPosition)
process.exit(1)
})
client.connect()