Please describe the problem you are having in as much detail as possible:
fetchMessages is not a function after update to dev for fix small sound cut ( after npm i discordjs/discord.js )
my code :
message.channel.fetchMessages({
limit: amount,
}).then((messages) => {
if (user) {
const filterBy = user ? user.id : Client.user.id;
messages = messages.filter(m => m.author.id === filterBy).array().slice(0, amount);
}
message.channel.bulkDelete(messages).catch(error => console.log(error.stack));
});
Error :
TypeError: message.channel.fetchMessage is not a function
at Object.exports.run (/var/botv2/commands/purge.js:6:19)
at Client.client.on.message (/var/botv2/bot.js:42:17)
at Client.emit (events.js:187:15)
at MessageCreateAction.handle (/var/botv2/node_modules/discord.js/src/client/actions/MessageCreate.js:24:14)
at MessageCreateHandler.handle (/var/botv2/node_modules/discord.js/src/client/websocket/packets/handlers/MessageCreate.js:5:53)
at WebSocketPacketManager.handle (/var/botv2/node_modules/discord.js/src/client/websocket/packets/WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (/var/botv2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:322:35)
at WebSocketConnection.onMessage (/var/botv2/node_modules/discord.js/src/client/websocket/WebSocketConnection.js:285:10)
at WebSocket.onMessage (/var/botv2/node_modules/ws/lib/event-target.js:120:16)
at WebSocket.emit (events.js:182:13)
ps : formating not work sorry
Further details:
discord.js version: discord.[email protected]
node.js version: v10.0.0
Operating system: linux ( Debian )
that's because its message.channel.messages.fetch now.
I recommend you ask in the Discord server and check the docs first.
Oh thx i dont see in docs 0.o and thx for discord i join now 馃槏
thanks this was helpful
Most helpful comment
that's because its
message.channel.messages.fetchnow.I recommend you ask in the Discord server and check the docs first.