Skip to content

Commit

Permalink
fix(qq): type error
Browse files Browse the repository at this point in the history
  • Loading branch information
XxLittleCxX committed Jan 22, 2024
1 parent f183e44 commit 15d693b
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 7 deletions.
5 changes: 2 additions & 3 deletions adapters/qq/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as QQ from './types'
import { QQBot } from './bot'
import { GroupInternal } from './internal/group'
import { GuildInternal } from './internal/guild'
import { GroupInternal, GuildInternal } from './internal'

export { QQ }

Expand All @@ -27,5 +26,5 @@ declare module '@satorijs/core' {
qqguild?: QQ.Payload & GuildInternal
}

interface Events extends QQEvents {}
interface Events extends QQEvents { }
}
2 changes: 1 addition & 1 deletion adapters/qq/src/internal/group.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as QQ from '../types'
import { GroupInternal } from '.'

declare module './index' {
declare module './internal' {
interface GroupInternal {
sendMessage(channel_id: string, data: QQ.Message.Request): Promise<{
id: string
Expand Down
2 changes: 1 addition & 1 deletion adapters/qq/src/internal/guild.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import * as QQ from '../types'
import { GuildInternal } from './internal'

declare module './index' {
declare module './internal' {
interface GuildInternal {
sendMessage(channelId: string, data: QQ.Message.ChannelRequest): Promise<QQ.Message>

Expand Down
4 changes: 2 additions & 2 deletions adapters/qq/src/message.ts
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@ export class QQMessageEncoder<C extends Context = Context> extends MessageEncode
}
const session = this.bot.session()
session.type = 'send'
const send = (async () => {
const send = async () => {
try {
if (this.session.isDirect) {
const { sendResult: { msg_id } } = await this.bot.internal.sendPrivateMessage(this.session.channelId, data)
Expand Down Expand Up @@ -265,7 +265,7 @@ export class QQMessageEncoder<C extends Context = Context> extends MessageEncode
await send()
}
}
}).bind(this)
}
await send()
this.content = ''
this.attachedFile = null
Expand Down
1 change: 1 addition & 0 deletions adapters/qq/src/ws.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ export class WsClient<C extends Context = Context> extends Adapter.WsClient<C, Q
})

this.socket.addEventListener('close', (e) => {
this.bot.logger.debug('websocket closed, code %o, reason: %s', e.code, e.reason)
clearInterval(this._ping)
})
}
Expand Down

0 comments on commit 15d693b

Please sign in to comment.