久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

TypeError:message.client.commands.array 不是函數

TypeError: message.client.commands.array is not a function(TypeError:message.client.commands.array 不是函數)
本文介紹了TypeError:message.client.commands.array 不是函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我想將我的幫助命令從 djs v12.5.3 更新到 v13,但出現此錯誤:TypeError: message.client.commands.array is not a function

I wanted to update my help command from djs v12.5.3 to v13 but I got this error: TypeError: message.client.commands.array is not a function

這是我之前使用的代碼:

Here is my code I used before:

let commands = message.client.commands.array();
commands.forEach((cmd) => {
    if(cmd.name == args[0].toLowerCase() || cmd.aliases.includes(args[0].toLowerCase())) {
                    embed.addField("**Description**", `${cmd.description}`, false)
                    embed.addField("**Usage**", `${cmd.usage}`, true)
                    embed.addField("**Aliases**", `${cmd.alias}`, true)
                    embed.addField("**Examples**", `${cmd.examples}`, true)
                    message.channel.send({ embeds: [embed] });
    }
})

我嘗試將 let commands = message.client.commands.array(); 更改為 let commands = message.client.commands.values(); 但得到了另一個錯誤:TypeError: commands.forEach 不是函數!如何在 v13 上再次列出我的命令?

I tried changing let commands = message.client.commands.array(); to let commands = message.client.commands.values(); but got another error: TypeError: commands.forEach is not a function! How can I list my commands again on v13?

推薦答案

該功能已被刪除.您需要執行以下操作,而不是 .array:

That function was removed. Instead of .array, you need to do the following:

let commands = [...message.client.commands.values()]

但是沒有理由轉換,除非您想輕松顯示所有值.

However there is no reason to convert, unless you want to display all the values easily.

message.client.commands.each 可以正常工作

message.client.commands.each((cmd) => {})

這篇關于TypeError:message.client.commands.array 不是函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

相關文檔推薦

Using discord.js to detect image and respond(使用 discord.js 檢測圖像并響應)
Check if user ID exists in Discord server(檢查 Discord 服務器中是否存在用戶 ID)
Guild Member Add does not work (discordjs)(公會成員添加不起作用(discordjs))
Creating my first bot using REPLIT but always error Discord.JS(使用 REPLIT 創建我的第一個機器人,但總是錯誤 Discord.JS)
How do I code event/command handlers for my Discord.js bot?(如何為我的 Discord.js 機器人編寫事件/命令處理程序?)
How to find a User ID from a Username in Discord.js?(如何從 Discord.js 中的用戶名中查找用戶 ID?)
主站蜘蛛池模板: 91视频一区二区三区 | 色综合视频在线 | 欧美久久久久久久久中文字幕 | 国产精品欧美一区二区三区不卡 | 国产精品一区二区三区在线 | 欧美区在线观看 | 国产精品免费一区二区三区四区 | 久久鲁视频 | 中文字幕伊人 | 9久久| 国产精品毛片无码 | 久久一区二区三区四区五区 | 日本在线视频一区二区 | 国产一区二区 | 天天爽天天操 | 欧美一区在线视频 | 国内精品一区二区三区 | 亚洲一区二区三区在线 | 狠狠的日| 成人在线视频网址 | 一区二区国产在线 | 国产精品免费看 | 久久久久国产精品一区 | 中文字幕在线一区 | a国产视频| 国产欧美在线 | 男人天堂色 | 国产在线精品免费 | 亚洲综合无码一区二区 | 国产精品夜夜夜一区二区三区尤 | 欧美区日韩区 | 欧美日韩不卡 | 日韩中文字幕在线播放 | 蜜桃精品视频在线 | 久久久久久高潮国产精品视 | 成人欧美 | 亚洲第一av| 欧美性生活一区二区三区 | 新疆少妇videos高潮 | 亚洲第一福利网 | 色接久久 |