Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug(discord): getGuildList等api调用出错 #262

Closed
Hieuzest opened this issue Apr 14, 2024 · 0 comments
Closed

Bug(discord): getGuildList等api调用出错 #262

Hieuzest opened this issue Apr 14, 2024 · 0 comments

Comments

@Hieuzest
Copy link
Contributor

getGuildList等一些api的默认参数after为undefined,这个undefined会被编码进get的参数里,导致服务器返回类型验证错误。

应当忽略此处的undefined,不清楚应当在undios侧修正还是在adapter处修正。

2024-04-14 13:25:14 [D] discord GET /users/@me/guilds { params: { after: undefined, limit: 200 } }
2024-04-14 13:25:14 [W] app Error: [400] {"message":"Invalid Form Body","code":50035,"errors":{"after":{"_errors":[{"code":"NUMBER_TYPE_COERCE","message":"Value \"undefined\" is not snowflake."}]}}}
                            at _Internal._Internal.<computed> (C:\Users\girki\AppData\Roaming\Koishi\Dev\node_modules\@satorijs\adapter-discord\src\types\internal.ts:36:21)
                            at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
                            at DiscordBot.getGuildList (C:\Users\girki\AppData\Roaming\Koishi\Dev\node_modules\@satorijs\adapter-discord\src\bot.ts:125:20)
                            at <anonymous> (c:\Users\girki\AppData\Roaming\Koishi\Dev\external\contextual-command\src\index.ts:45:17)

this.bot.logger.debug(`${method} ${url}`, config)
return (await this.bot.http(method, url, config)).data

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant