Editing message

I am making a bot that will update a message every hour, the code works so far but when trying to edit the message it gives the error that the command or function is not found and wfter a bit of looking i couldn#t find the problem:
Header:
const { Client, Intents, GatewayIntentBits, IntentsBitField} = require('discord.js');
const client = new Client({ intents: [IntentsBitField.Flags.Guilds, IntentsBitField.Flags.GuildMessages, GatewayIntentBits.MessageContent], autoReconnect: true });


Creating message:
countDownMsg = client.channels.cache.find(channel => channel.name === 'announcements-‧₊˚✩').send(`# NEXT STAIRCLIMB <t:${nextHourS}:R> #`); 


Editing message:
countDownMsg.edit(`# NEXT STAIRCLIMB <t:${nextHourS}:R> #\nLast one  <t:${lastHourS}:R>`)
        .then(msg => console.log(`Updated the content of a message to ${msg.content}`))
        .catch(console.error);


Error:
C:\Discord.js\timerBot.js:14
    countDownMsg.edit(`# NEXT STAIRCLIMB <t:${nextHourS}:R> #\nLast one  <t:${lastHourS}:R>`)
                 ^

TypeError: countDownMsg.edit is not a function
    at Timeout.changeTime [as _onTimeout] (C:\Discord.js\timerBot.js:14:18)
    at listOnTimeout (node:internal/timers:573:17)
    at process.processTimers (node:internal/timers:514:7)

Node.js v20.8.1
Was this page helpful?