First off, greeting users is generally considered a really bad idea, many people don’t appreciate it so make sure you only do it in channels that specifically asked for your bot to be there and do that.
Secondly, you’re creating the client.on('chat', ... listeners inside a loop, you should really try to have just a single listener for each event type.
A much simpler design would be to just create an object that has an array for each channel, and a single listener, eg:
const greetedUsers = {};
channelList.forEach(channel => greetedUsers[channel] = []);
client.on('chat', (channel, user, message, self) => {
if (!greedUsers[channel].includes(user.username)) {
greedUsers[channel].push(user.username);
// do your greeting
}
});