harmony/src/test/debug.ts

28 lines
584 B
TypeScript
Raw Normal View History

2021-03-29 04:09:37 +00:00
import { Client, event } from '../../mod.ts'
import { TOKEN } from './config.ts'
class MyClient extends Client {
constructor() {
super({
token: TOKEN,
intents: [],
})
}
@event()
ready(): void {
console.log('Connected!')
}
debug(title: string, msg: string): void {
console.log(`[${title}] ${msg}`)
if (title === 'Gateway' && msg === 'Initializing WebSocket...') {
try { throw new Error("Stack") } catch (e) {
console.log(e.stack)
}
}
}
}
const client = new MyClient()
client.connect()