I’m working on a twitch bot for a friend and it is my first time coding in javascript I am familiar with java python and C# already and wanted to dip my toes into Javascript and was making a bot for my friend who streams he wanted a bot that can make a queue for followers to join on “!join queue” it should say @user has joined the queue and on “!queue” it should list the viewers who requested to join from earliest to latest and on “!queue next” only accessible by moderators it should take the top person out and move to the next and on “!queue remove” only accessible by moderators it should remove somebody from the queue if needed and finally “!leave queue” to manually leave the queue. I have made some progress but cannot figure out how to store somebody’s username into a list or an array so I can put them in a list here is my code:
`` `
const tmi = require(‘tmi.js’),
{ channel, username, password } = require(’./settings.json’);
const options = {
options: { debug: true },
connection: {
reconnect: true,
secure: true
},
identity : {
username,
password
},
channels: [channel]
};
const client = new tmi.Client(options);
client.connect().catch(console.error);
client.on(‘connected’, () => {
client.say(channel, ${username} has connected!
);
});
client.on(‘message’, (channel, user, message, self) => {
if(self) return;
if(message == '!join que') {
client.say(channel, `@${user.username}, has joined the que`);
}
const users = []
})