所以,这是我的不和谐机器人的代码。它的目的是清除多达 100 条消息,但是每当我尝试使用“return message.reply”命令时,我都会收到错误消息:“TypeError:message.reply 不是函数”这是我拥有的代码:
var Discord = require('discord.js');
exports.run = async(message, args) =>{
if(!args[0]) return message.reply("please specify the amount of messages that you would like me to purge!")
if(isNaN(args[0])) return message.reply('please enter a number after the command!')
if(args[0] > 100) return message.reply('you cannot delete more than 100 messages at a time!')
if(args[0] < 1) return message.reply('you cannot purge a number less than 1!')
await message.channel.messages.fetch({limit: args[0]}).then(messages => {
message.channel.bulkDelete(messages);
});
}