delete message on ready event

i tried to exclude a message in event.js but that just doesn't work
interaction.channel.messages.fetch(messageid)
.then(message => { message.delete() })
.catch(() => { return; });
interaction.channel.messages.fetch(messageid)
.then(message => { message.delete() })
.catch(() => { return; });
my error:
TypeError: Cannot read properties of undefined (reading 'messages')
TypeError: Cannot read properties of undefined (reading 'messages')
the interaction it's on parameters of my module.exports
module.exports = async (client, interaction) => {
...
module.exports = async (client, interaction) => {
...
4 Replies
d.js toolkit
d.js toolkit7mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by OP
Thiago
ThiagoOP7mo ago
so my question is: i can fetch a message without fetch the channel first?
-Carlos👑
-Carlos👑7mo ago
not possible
Thiago
ThiagoOP7mo ago
i get it thx
Want results from more Discord servers?
Add your server