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

TypeError:message.client.commands.array 不是函數(shù)

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

問題描述

我想將我的幫助命令從 djs v12.5.3 更新到 v13,但出現(xiàn)此錯誤: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 不是函數(shù)!如何在 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?

推薦答案

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

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

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

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

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) => {})

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

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

相關(guān)文檔推薦

Using discord.js to detect image and respond(使用 discord.js 檢測圖像并響應(yīng))
Check if user ID exists in Discord server(檢查 Discord 服務(wù)器中是否存在用戶 ID)
Guild Member Add does not work (discordjs)(公會成員添加不起作用(discordjs))
Creating my first bot using REPLIT but always error Discord.JS(使用 REPLIT 創(chuàng)建我的第一個機器人,但總是錯誤 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?)
主站蜘蛛池模板: 国产免费一区二区三区 | 国产成人精品久久二区二区 | 97色免费视频 | 一区二区三区欧美在线观看 | 国产精品一区二区三区在线播放 | 国产免费观看一区 | 一区二区三区精品视频 | 久草免费在线视频 | 日本视频在线播放 | 一二区成人影院电影网 | 成人片免费看 | 丝袜一区二区三区 | 日韩中文字幕视频在线 | 国产精品视频不卡 | 一级特黄网站 | 欧美日本韩国一区二区三区 | 中文字幕视频一区 | 一级做a| 精品国产区 | 国产高潮好爽受不了了夜色 | 成人亚洲一区 | 日韩第一区 | 狠狠艹 | 成年视频在线观看福利资源 | 欧美视频在线看 | 中文字幕一区二区三区在线观看 | 精品一区二区久久久久久久网站 | 亚洲国产成人精品女人久久久 | 国产精品美女一区二区 | 黄频免费 | 男女网站免费观看 | 国产精品久久久久久久久久免费看 | 国产91综合 | 欧美性猛交一区二区三区精品 | 欧美黄 片免费观看 | 日本中文字幕在线观看 | 国产精品不卡一区 | 久久精品国产精品青草 | 色精品视频 | 国产欧美一区二区三区久久人妖 | 欧美xxxx在线 |