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

adapter-discord 分段发送失败时继续发送后面的部分 #267

Closed
dragon-fish opened this issue May 9, 2021 · 5 comments
Closed
Milestone

Comments

@dragon-fish
Copy link
Member

Is your feature request related to a problem? Please describe.

有时候消息夹杂图片,adapter-discord 的行为是将消息分段发送,一旦图片发送失败,后面的内容就不会发送。

例如有这样一个信息:

前面的文字
[图片]
后面的文字

如果图片发送失败,后面的文字就无了。

Describe the solution you'd like

希望在某段信息发送失败后,继续发送后面的片段。

Describe alternatives you've considered

Additional context

@shigma
Copy link
Member

shigma commented May 9, 2021

我觉得可以。不过这样一来,如果中间某些片段发不出去,就应该抛出一个 AggregateError,这是 Node 15 的特性。需要考虑一下是引入 polyfill 还是强制用户升级(

@dragon-fish
Copy link
Member Author

目前主流的 Node 版本应该依然是 12 和 14,强迫用户升级可能不太现实

@shigma
Copy link
Member

shigma commented May 9, 2021

那就等到用户都升到 16 以后实装这个特性好了(

@dragon-fish
Copy link
Member Author

那怕是要等 114514 年

@shigma shigma added this to the 3.13 milestone Jun 29, 2021
@shigma
Copy link
Member

shigma commented Jul 7, 2021

这个 polyfill 我觉得可以接受:https://github.com/es-shims/AggregateError

然后可能需要 utils 里面开个后门处理 AggregateError 的错误信息。

@shigma shigma closed this as completed in 7dd8292 Jul 30, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants