peachii
DIAdiscord.js - Imagine a bot
•Created by peachii on 8/3/2024 in #djs-questions
Help with error: TypeError: (intermediate value).setName is not a function
I am getting this error when trying to execute a message delete command.
The goal is to delete a message using the message id of a message, then to send the user whose message was deleted, the log. I receive this error when it comes to sending the log.
Error:
Code:
The problem code is in my embed builder:
I don't understand why I'm receiving this error as I've defined the embed builder at the beginning of the file? So the .setName function shouldnt be sending an error.
I would love some help ;-; Thank you
6 replies
DIAdiscord.js - Imagine a bot
•Created by peachii on 7/8/2024 in #djs-questions
TypeError: Cannot read properties of undefined (reading 'send')
i did find a few posts on this error but no amount of research or looking through documentation has fixed my issue.
basically, im receiving this error when i try to send a message from my discord bot to a specific channel using client.channels.cashe.get
problem code:
const channel = client.channels.cache.find(channel => channel.id === "915481280538370059");
await interaction.reply({content: 'User kicked :peachcord_checkmark:', ephemeral: true});
await channel.send({embeds: [embed]})
interaction.guild.members.kick(user);
the problem is said to be with this line:
await channel.send({embeds: [embed]})
the previous code is not necessary as its just my slash command builder and the issue is with the method im trying to use to send this message, but if its needed i can provide.
if possible i would greatly appreciate some help ;-;33 replies