8wDlpd.png
8wDFp9.png
8wDEOx.png
8wDMfH.png
8wDKte.png

async get 在从 discord 频道下载文件时出现奇怪的问题。discord js

user2056647 2月前

18 0

我正在让机器人从消息中下载文件,但发生了奇怪的错误const get = require(\'async-get-file \'); if(message.attachments.first()){mess...

我正在让机器人从消息中下载文件,但发生了奇怪的错误

const get = require("async-get-file");
                if(message.attachments.first()){
                message.channel.send('Uploading...');
                        var options = {
                            directory: "pac-man_discordserver/"
   // directory: "./images/cats/",
   // filename: message.attachments.name
}
            await get(message.attachments.first().url,options);
            message.channel.send('Successfully uploaded in server!');
            return;
                }

错误:

node:events:497
      throw er; // Unhandled 'error' event
      ^

Error: ENOENT: no such file or directory, open 'C:\Users\Users\Documents\Yumebot\build\pac-man_discordserver\README.md?ex=66cc0020&is=66caaea0&hm=a9d5d5e0d71399ae983c5e752fa27ae069f300a907816bcfb4b4c6e918ccf108&'
Emitted 'error' event on WriteStream instance at:
    at WriteStream.onerror (node:internal/streams/readable:1026:14)
    at WriteStream.emit (node:events:519:28)
    at emitErrorNT (node:internal/streams/destroy:169:8)
    at emitErrorCloseNT (node:internal/streams/destroy:128:3)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
  errno: -4058,
  code: 'ENOENT',
  syscall: 'open',
  path: 'C:\\Users\\Users\\Documents\\Yumebot\\build\\pac-man_discordserver\\README.md?ex=66cc0020&is=66caaea0&hm=a9d5d5e0d71399ae983c5e752fa27ae069f300a907816bcfb4b4c6e918ccf108&'
}

Node.js v20.16.0

默认情况下,如果邮件包含文件,则必须将其下载到目录中,但由于未知原因,它并未这样做

帖子版权声明 1、本帖标题:async get 在从 discord 频道下载文件时出现奇怪的问题。discord js
    本站网址:http://xjnalaquan.com/
2、本网站的资源部分来源于网络,如有侵权,请联系站长进行删除处理。
3、会员发帖仅代表会员个人观点,并不代表本站赞同其观点和对其真实性负责。
4、本站一律禁止以任何方式发布或转载任何违法的相关信息,访客发现请向站长举报
5、站长邮箱:yeweds@126.com 除非注明,本帖由user2056647在本站《node.js》版块原创发布, 转载请注明出处!
最新回复 (0)
返回
作者最近主题: