Skip to content

Commit

Permalink
Update http.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
idranme committed Nov 23, 2024
1 parent 965c091 commit 88995e1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adapters/qq/src/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Adapter, Binary, Context, Schema, Universal } from '@satorijs/core'
import { getPublicKeyAsync, signAsync, verifyAsync } from '@noble/ed25519'
import { QQBot } from './bot'
import { Opcode, Payload } from './types'
import { adaptSession, decodeUser } from './utils'
import { adaptSession } from './utils'
import { IncomingHttpHeaders } from 'node:http'
import { } from '@cordisjs/plugin-server'

Expand All @@ -27,7 +27,7 @@ export class HttpServer<C extends Context = Context> extends Adapter<C, QQBot<C>
const sig = await signAsync(new TextEncoder().encode(data), key)
ctx.body = {
plain_token: payload.d.plain_token,
signature: Binary.toHex(sig)
signature: Binary.toHex(sig),
}
} else if (payload.op === Opcode.DISPATCH) {
// https://bot.q.qq.com/wiki/develop/api-v2/dev-prepare/interface-framework/sign.html
Expand All @@ -51,7 +51,7 @@ export class HttpServer<C extends Context = Context> extends Adapter<C, QQBot<C>

ctx.body = {
d: {},
op: Opcode.HTTP_CALLBACK_ACK
op: Opcode.HTTP_CALLBACK_ACK,
}
})
}
Expand Down

0 comments on commit 88995e1

Please sign in to comment.