How do delete interaction message?

Hello. I have a command that when you run it, it will send a message with 2 buttons. When you press 1st button it will edit the message that works fine, but when you press the second button, it should delete the message & then send a new ephemeral message.

I use interaction.message.delete() but i get a error: TypeError: Cannot read properties of undefined (reading 'delete')
Was this page helpful?