harmony/test/debug.ts

31 lines
598 B
TypeScript
Raw Normal View History

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