Good morning, I'm sorry for the inconvenience.
I'm trying to edit a message that I sent with my bot a few days ago, but it won't let me edit it.
I'm sure it's because it's been about 7 days, but even so, I would like to know if there is a way to edit that message.
Thanks and again, sorry for the inconvenience.
client.on('message', async (message) => {
if (message.content === '!update-info') {
if (!message.member.hasPermission('MANAGE_MESSAGES')) {
return message.channel.send('Only server moderators can run this command!')
}
const guild = client.guilds.cache.get('734517639732396122');
if (!guild) return console.log('Unable to find guild.');
const channel = guild.channels.cache.find(c => c.id === '737363248126492772' && c.type === 'text');
if (!channel) return console.log('Unable to find channel.');
try {
const messageedit = await message.channel.messages.fetch('815522275344252928');
if (!message) return console.log('Unable to find message.');
await messageedit.edit("__**Reacciona para activar notificacioness**__\n\n`Actualizaciones:` <:update:815505836880429087> \n`Twitter:` <:twitter:815505836842942474> \n`Facebook:` <:facebook:815505775278424084>\n`Instagram:` <:instagram:815505836608454667>");
console.log('Mensaje de informacion actualizado.');
} catch(err) {
console.error(err);
}
message.delete();
}
});
DiscordAPIError: Unknown Message
at RequestHandler.execute (/home/bungee/Discord-Bots/Uniito-bot/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
at processTicksAndRejections (internal/process/task_queues.js:97:5) at async RequestHandler.push (/home/bungee/Discord-Bots/Uniito-bot/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
at async MessageManager._fetchId (/home/bungee/Discord-Bots/Uniito-bot/node_modules/discord.js/src/managers/MessageManager.js:135
at async Client. (/home/bungee/Discord-Bots/Uniito-bot/client.js:105:33) { method: 'get', path: '/channels/738226897690820680/messages/815522275344252928', code: 10008, httpStatus: 404 }
message
is defined after calling it.. Maybe you meanmessageedit
? – Pogrindis