Skip to content

Commit

Permalink
fix(qq): fix sandbox for group bot (#191)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilharp authored Nov 26, 2023
1 parent d740216 commit 03bded7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion adapters/qq/src/bot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ export class QQBot<C extends Context = Context> extends Bot<C, QQBot.Config> {
appId: this.config.id,
clientSecret: this.config.secret,
})
let endpoint = this.config.endpoint
if (this.config.sandbox) {
endpoint = endpoint.replace(/^(https?:\/\/)/, '$1sandbox.')
}
this._token = result.access_token
this.groupHttp = this.ctx.http.extend({
endpoint: this.config.endpoint,
endpoint,
headers: {
'Authorization': `QQBot ${this._token}`,
'X-Union-Appid': this.config.id,
Expand Down

0 comments on commit 03bded7

Please sign in to comment.