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

DeprecationWarning: Collection#find: 傳遞一個函數

DeprecationWarning: Collection#find: pass a function instead(DeprecationWarning: Collection#find: 傳遞一個函數)
本文介紹了DeprecationWarning: Collection#find: 傳遞一個函數的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我是 node.js 的新手,我目前正在使用 discord.js 來制作 Discord 機器人.一旦使用了任何 bot 命令,控制臺就會打印出 DeprecationWarning.例如:

I'm quite a newbie to node.js and I'm currently using discord.js to make a Discord bot. As soon as any bot command gets used the console prints a DeprecationWarning. for example:

(node:15656) DeprecationWarning: Collection#find: pass a function instead

(node:15656) 有時是另一個數字,幾乎總是在變化.
這就是我的代碼的樣子(只有一個命令,我有多個命令,不過我都收到了這個錯誤):

(node:15656) sometimes is another number, nearly always changing.
This is what my code looks like (only one command, I've got multiple, I get this error with all of them though):

const botconfig = require("./botconfig.json")
const Discord = require("discord.js");
const bot = new Discord.Client();

bot.on("ready", () => { 
    console.log(`Launched ${bot.user.username}...`);
    bot.user.setActivity("Games", { type: "PLAYING" });
});

bot.on("message", async message => {
    if (message.author.bot) return;

    let prefix = botconfig.prefix;
    let messageArray = message.content.split(" ");
    let cmd = messageArray[0];
    let args = messageArray.slice(1);
    let botico = bot.user.displayAvatarURL;

    if (cmd == `${prefix}help`) {
        let helpEmbed = new Discord.RichEmbed()
            .addField(".kick", "kick a user", true)
            .addField(".ban", "ban a user", true)
            .addField(".unban", "unbans a user", true)
            .addField(".mute", "mutes a user over a period of time", true)
            .setColor("#005b5f")
            .setThumbnail(botico);

        message.channel.send(helpEmbed);
        console.log(`command used: help`);
    };
});

bot.login(botconfig.token)

推薦答案

它在您的其他命令之一中.您很可能在其他命令之一中使用了類似 #Collection.find('name', 'keyname') 的東西.

It is in one of your other commands. You more than likely are using something like #Collection.find('name', 'keyname') in one of the other commands.

這已更新為 #Collection.find(x => x.name === "name").

就像它在錯誤中所說的那樣.#Collection.find() 需要一個函數.所以使用一個,錯誤就會消失.

Like it says in the error. #Collection.find() requires a function instead. So use one and the error goes away.

這篇關于DeprecationWarning: Collection#find: 傳遞一個函數的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持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?)
主站蜘蛛池模板: 亚洲综合区 | 少妇高潮露脸国语对白 | 久久在线精品 | 伦一理一级一a一片 | 国产原创精品 | 天天躁日日躁狠狠躁 | 午夜视频免费观看 | 国产成人精品一区二 | 免费看毛片网站 | 黄色一极片 | 日本亚洲精品 | 国v精品久久久网 | 可以看毛片的网站 | 亚洲在线观看视频 | 精品亚洲国产成人av制服丝袜 | 欧美日韩免费在线观看 | 日产精品久久久一区二区 | 青娱乐福利视频 | 97视频在线观看免费 | 国产精品成人国产乱一区 | 欧美日韩中文字幕在线 | 国产农村妇女精品一二区 | 国产又黄又粗 | 亚洲三级黄色片 | 精品一二三 | 91插插插插 | 欧美日本国产 | 日韩欧美精品一区二区 | 国产三级做爰高清在线 | 激情视频网址 | 蜜臀av在线播放 | 久久久久蜜桃 | 天海翼在线视频 | 99这里有精品 | 久久久久国产精品夜夜夜夜夜 | 一区二区欧美日韩 | 天堂在线观看av | 最新国产精品 | 福利视频二区 | 精品乱子伦一区二区三区 | 精品日韩一区 |