harmony/test/debug.ts
2021-04-04 11:22:47 +05:30

30 lines
598 B
TypeScript

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()