I'm currently working on creating a discord bot that will send a message to a specific channel upon startup. Initially, I was able to send the message to the designated channel without any issues. However, when I attempted to edit the message, an error was thrown indicating that message.edit
is not a function. I've been following the instructions directly from the documentation, but it doesn't seem to be working as expected. Can anyone explain why this is happening and provide guidance on how to resolve this issue?
let message: any;
if (isTextChannel(channel) && !isStageChannel(channel)) {
message = channel.send({ embeds: [ playerCountEmbedLoading() ] });
}
setInterval(() => {
if (isTextChannel(channel) && !isStageChannel(channel)) {
return message.edit({ embeds: [ playerCountEmbed() ] })
}