小编zEx*_*rem的帖子

Discord.JS fetchMessage()

I have a problem with my Discord.JS Bot, I wanna to edit a embed in a spefic guild and channel, but when I try to run the commands, it errors out with this

/root/my-bot/my-bot.js:550
    guild.channels.get(channel).fetchMessage(user).edit(newMessage);
                               ^

TypeError: Cannot read property 'fetchMessage' of undefined
at Client.<anonymous> (/root/my-bot/my-bot.js:550:31)
at Client.emit (events.js:315:20)
at MessageCreateHandler.handle (/root/my-bot/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:9:34)
at WebSocketPacketManager.handle (/root/my-bot/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:105:65)
at WebSocketConnection.onPacket (/root/my-bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (/root/my-bot/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:296:17)
at WebSocket.onMessage (/root/my-bot/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:315:20)
at Receiver.receiverOnMessage (/root/my-bot/node_modules/ws/lib/websocket.js:789:20)
at Receiver.emit (events.js:315:20)
Run Code Online (Sandbox Code Playgroud)

Here's my command code:

 if(message.content.startsWith(prefix + "edit")) …
Run Code Online (Sandbox Code Playgroud)

javascript fetch node.js discord.js

0
推荐指数
1
解决办法
1504
查看次数

标签 统计

discord.js ×1

fetch ×1

javascript ×1

node.js ×1