这是我的代码
const botID = '986945043849945088'
let msgID = await message.channel.messages.fetch(args[0]).catch(() => undefined);
if (msgID.includes(botID)) return message.reply(`This message does not belong to <@${client.user.id}>`)
if (msgID === undefined) {
return message.reply('Wrong Message ID!')
} else {
await msgID.edit(args[1]).then(() => message.delete())
错误:
TypeError:是否。在Object.exports.callback (/home/runner/J-Bot/Commands/edit.js:30:17)
msgID为message
。所以没有includes
函数。
const botID = '986945043849945088'
let msgID = await message.channel.messages.fetch(args[0]).catch(() => undefined);
if (msgID.author.id != botID) return message.reply(`This message does not belong to <@${client.user.id}>`)
if (msgID === undefined) {
return message.reply('Wrong Message ID!')
} else {
await msgID.edit(args[1]).then(() => message.delete())