修正一处pr错误

This commit is contained in:
Kokomi 2023-06-07 05:45:41 +08:00
parent 4cd5558f8d
commit 44a01bf838
1 changed files with 4 additions and 4 deletions

View File

@ -34,11 +34,11 @@ function sleep (ms) {
* @param fileUrl 下载地址 * @param fileUrl 下载地址
* @param savePath 保存路径 * @param savePath 保存路径
*/ */
async function downFile (fileUrl, savePath,param = {}) { async function downFile (fileUrl, savePath, param = {}) {
try { try {
mkdirs(path.dirname(savePath)) mkdirs(path.dirname(savePath))
logger.debug(`[下载文件] ${fileUrl}`) logger.debug(`[下载文件] ${fileUrl}`)
const response = await fetch(fileUrl,param) const response = await fetch(fileUrl, param)
const streamPipeline = promisify(pipeline) const streamPipeline = promisify(pipeline)
await streamPipeline(response.body, fs.createWriteStream(savePath)) await streamPipeline(response.body, fs.createWriteStream(savePath))
return true return true
@ -68,7 +68,7 @@ function mkdirs (dirname) {
*/ */
async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) { async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) {
// 是频道直接返回 join // 是频道直接返回 join
if (e.isGuild) return msg.join("\n") if (e.isGuild) return msg.join('\n')
let name = msgsscr ? this.e.sender.card || this.e.user_id : Bot.nickname let name = msgsscr ? this.e.sender.card || this.e.user_id : Bot.nickname
let id = msgsscr ? this.e.user_id : Bot.uin let id = msgsscr ? this.e.user_id : Bot.uin
@ -77,7 +77,7 @@ async function makeForwardMsg (e, msg = [], dec = '', msgsscr = false) {
} }
let userInfo = { let userInfo = {
user_id: id user_id: id,
nickname: name nickname: name
} }