user16284023
user16284023

Reputation:

Cannot read properties of undefined (reading 'delete') in Discord.js V13

I have been getting this error in the "interactionCreate" event in my bot, this error causes my bot to shut down every time it occurs.

TypeError: Cannot read properties of undefined (reading 'delete')
at Timeout._onTimeout (/root/Teyrox/GamesMadeInPolaDiscordBot/events/servidores/interactionCreate.js:12:403)
  at listOnTimeout (node:internal/timers:557:17)
  at processTimers (node:internal/timers:500:7)

The error occurs in this line of code, and after a while of research and checking I did not find any error in this line of code

if (aBoolean) return interaction.reply({ content: `<:x_:677580192641843222>`, ephemeral: true }).then(m => setTimeout(() => m.delete().catch(() => { }), 15000));

Upvotes: 1

Views: 3121

Answers (1)

Compositr
Compositr

Reputation: 737

I searched on the internet and found this gitmemory forum. I states that:

...we can only edit Ephemeral Message but we can't delete Ephemeral Message...

You can't delete Ephemeral messages. They're designed to be dismissed by the recipient of the message

Upvotes: 1

Related Questions