Bot doesn't send message anymore and throws an error

If you’re using TMI try this instead
and see if this works for u i use TMI myself and see a lot that is not basic and for beginners to TMI or JavaScript

// Script requirements //

const tmi = require(‘tmi.js’);
const { channel } = require(‘tmi.js/lib/utils’);
//const { channel } = require(‘tmi.js/lib/utils’);

//(Use this if you use a .env)//
require(‘dotenv’).config();
//////////////////////////////////////////////////////
const opts = {
options: { debug: true,},
connection: {
reconnect: true,
secure: true,
},

//Channel / Bot login (replace process.env.USER_TOKEN with the needed info like bot username and auth token and youre channel info if you dont use a .env or testing) //

identity: {
    username: process.env.USER_TOKEN,
    password: process.env.AUTH_TOKEN
},
channels: [ process.env.CHANNEL_TOKEN ]

};

//Bot Connected to twitch //
const client = new tmi.client(opts);
client.connect().catch(console.error);
client.on(‘connected’, (channel, address, port) => {
client.say(process.env.CHANNEL_TOKEN, ‘Hello world!’)
});