Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
idranme committed Jul 24, 2024
1 parent 44b6ac6 commit 56d01ea
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion adapters/qq/src/internal/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Bot, Dict, HTTP, makeArray } from '@satorijs/core'
export class Internal {
constructor(private bot: Bot, private http: () => HTTP) { }

static define(isGuild: boolean, routes: Dict<Partial<Record<HTTP.Method, string | string[]>>>, config: HTTP.RequestConfig = {}) {
static define(isGuild: boolean, routes: Dict<Partial<Record<HTTP.Method, string | string[]>>>, preset: HTTP.RequestConfig = {}) {
for (const path in routes) {
for (const key in routes[path]) {
const method = key as HTTP.Method
Expand All @@ -14,6 +14,7 @@ export class Internal {
if (!args.length) throw new Error(`too few arguments for ${path}, received ${raw}`)
return args.shift()
})
const config: HTTP.RequestConfig = { ...preset }
if (args.length === 1) {
if (method === 'GET' || method === 'DELETE') {
config.params = args[0]
Expand Down

0 comments on commit 56d01ea

Please sign in to comment.