简体   繁体   中英

Discord Bot ERROR “MaxListenersExceededWarning”

Would mean a lot if someone could help. Been trying to fix this for ages. Do you guys think there is a possibility to fix it?

C:\Users\WFMod\Desktop\CTZY Bot>node .
    (node:11384) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 message listeners added to [Client]. Use emitter.setMaxListeners() to increase limit
    Bot is online.
    C:\Users\WFMod\Desktop\CTZY Bot\index.js:789       
                const ghembed = new Discord.RichEmbed()
                                ^

    TypeError: Discord.RichEmbed is not a constructor
        at Client.<anonymous> (C:\Users\WFMod\Desktop\CTZY Bot\index.js:789:29)
        at Client.emit (events.js:326:22)
        at MessageCreateAction.handle (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\discord.js\src\client\actions\MessageCreate.js:31:14)
        at Object.module.exports [as MESSAGE_CREATE] (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\discord.js\src\client\websocket\handlers\MESSAGE_CREATE.js:4:32)
        at WebSocketManager.handlePacket (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
        at WebSocketShard.onPacket (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
        at WebSocketShard.onMessage (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
        at WebSocket.onMessage (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\ws\lib\event-target.js:132:16)
        at WebSocket.emit (events.js:314:20)
        at Receiver.receiverOnMessage (C:\Users\WFMod\Desktop\CTZY Bot\node_modules\ws\lib\websocket.js:825:20)

    C:\Users\WFMod\Desktop\CTZY Bot>

As the error suggests, Discord.RichEmbed is no longer a constructor as of Discord JS v12. Use Discord.MessageEmbed .


const ghembed = new Discord.MessageEmbed();

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM