发送"canvas"生成的图片,不保存到文件

Send the image generated by "canvas", without saving it to a file

是否可以将图像作为 base64、缓冲区或数据发送URL? 正如我在源代码 Discord.JS 中看到的那样,它只能附加 URL、文件或管道流。但是还有别的办法吗?

我不是很喜欢这个东西,但我认为你可以发送一个缓冲区:在 TextChannel.send() it says that you can send a BufferResolvable, either by sending an Attachment with that file or by setting that as .file in the MessageOptions 的文档中你传入 send() 函数。

问题在于 Federico Grandi 的回答中描述的方法, 不适用于 11.1.0 版。 (处理缓冲区的函数未定义)。

升级到11.3.2版本后,问题解决