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

DeprecationWarning:消息事件已被棄用.改用 messageCre

DeprecationWarning: The message event is deprecated. Use messageCreate instead(DeprecationWarning:消息事件已被棄用.改用 messageCreate)
本文介紹了DeprecationWarning:消息事件已被棄用.改用 messageCreate的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

問題描述

我對不和諧機器人相對較新,但我一生都無法弄清楚為什么我不斷收到此錯誤 - 我試圖用 message creat 替換 message,但它似乎根本不起作用.這是我的代碼:

I am relatively new to discord bots but I cant for the life of me figure out why I keep getting this error - I have tried to replace message with message creat but it doesn't seem to work at all. Here is my code:

client.on('message', (message) => {
    if(message.author.client) return; 
    if(message.channel.type !== 'text') return;
    let prefix = '!'; 
    let MessageArray = message.content.split(' ');
    let cmd = MessageArray(0).slice(prefix.length)
    let args = MessageArray.slice(1)

    if(!message.content.startsWith(prefix)) return; 

    if(cmd == 'hello') {
        message.channel.send({ messages: ['hello'] });
    })

推薦答案

message 事件已重命名為 messageCreate.使用 message 仍然有效,但在您切換之前,您會收到棄用警告.

The message event has been renamed to messageCreate. Using message will still work, but you'll receive a deprecation warning until you switch over.

client.on("messageCreate", (message) => {
    if (message.author.client) return;
    if (message.channel.type !== "text") return;
    let prefix = "!";
    let MessageArray = message.content.split(" ");
    let cmd = MessageArray(0).slice(prefix.length);
    let args = MessageArray.slice(1);

    if (!message.content.startsWith(prefix)) return;

    if (cmd == "hello") {
        message.channel.send({ messages: ["hello"] });
    }
});

這篇關(guān)于DeprecationWarning:消息事件已被棄用.改用 messageCreate的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網(wǎng)!

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

相關(guān)文檔推薦

discord.js v12: How do I await for messages in a DM channel?(discord.js v12:我如何等待 DM 頻道中的消息?)
how to make my bot mention the person who gave that bot command(如何讓我的機器人提及發(fā)出該機器人命令的人)
How to fix Must use import to load ES Module discord.js(如何修復必須使用導入來加載 ES 模塊 discord.js)
How to list all members from a specific server?(如何列出來自特定服務器的所有成員?)
Discord bot: Fix ‘FFMPEG not found’(Discord bot:修復“找不到 FFMPEG)
Welcome message when joining discord Server using discord.js(使用 discord.js 加入 discord 服務器時的歡迎消息)
主站蜘蛛池模板: 在线观看国产视频 | 欧美视频二区 | 一区在线播放 | 天堂色网| 久久久久久免费精品一区二区三区 | 91色视频在线 | 亚洲欧洲一区二区 | 久久鲁视频| 国产香蕉视频在线播放 | 久久综合久色欧美综合狠狠 | 国产乱码一二三区精品 | 97国产精品 | 国产精品一区视频 | 日本精品在线播放 | 欧美日韩综合精品 | 麻豆国产精品777777在线 | 99久久免费精品国产男女高不卡 | 日韩亚洲视频 | 99久久中文字幕三级久久日本 | 国产99视频精品免费播放照片 | 亚洲欧美一区二区三区国产精品 | 久久精品在线 | 国产精品国色综合久久 | 亚洲欧美国产一区二区三区 | 精品国产一区二区三区性色av | 久久久.com| 亚洲精品久久久久久国产精华液 | 在线欧美激情 | 免费高潮视频95在线观看网站 | 精品国产一区二区三区日日嗨 | 久久精品国产免费 | 一级黄色夫妻生活 | 午夜视频免费网站 | 色综合av | 污片在线观看 | 国产成人精品一区二三区在线观看 | 久久九 | 亚洲一区二区三区视频在线 | 亚洲一区在线日韩在线深爱 | 亚洲欧美日韩成人在线 | 亚洲午夜精品在线观看 |