Skip to content

Commit

Permalink
fix(core): dispatch login event after bot construct
Browse files Browse the repository at this point in the history
  • Loading branch information
shigma committed Oct 22, 2023
1 parent 52c5d14 commit 062cde0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/axios/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export interface Quester {
}

export class Quester {
constructor(config: Quester.Config) {
constructor(config: Quester.Config = {}) {
const request = async (config: AxiosRequestConfig = {}) => {
const options = http.prepare()
const error = new Error() as Axios.AxiosError
Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ export abstract class Bot<C extends Context = Context, T = any> implements Login
ctx.bots.push(this)
this.context.emit('bot-added', this)

ctx.on('ready', () => {
ctx.on('ready', async () => {
await Promise.resolve()
this.dispatchLoginEvent('login-added')
return this.start()
})
Expand Down

0 comments on commit 062cde0

Please sign in to comment.