async function sendUsers(message, pageNum, newMessage) {
    const listAmount = 2;
    var groupedArr = createGroupedArray(queueVCList, listAmount);
    //console.log(groupedArr);
    
    // Sets a default page num, or makes it human readable
    if (pageNum === undefined) pageNum = 1; else {
        if (pageNum < 1) pageNum = 1;
        if (groupedArr.length < pageNum) pageNum = groupedArr.length;
    }

    // Checks if page number is valid
    if (pageNum > groupedArr.length) {
        // If it's longer than actual length, but isn't just an empty inventory
        if (!groupedArr.length === 0) return;  
    }

    //console.log(pageNum);

    var displayNameString = "";

    // Grabs user in loop, parses it, then adds it to "displayNameString" variable
    if (groupedArr[pageNum - 1]) {
        groupedArr[pageNum - 1].forEach(element => {
            var actualQueueNumber = queueVCList.findIndex(m => m.user.id === element.user.id)
            //console.log("[Actual Queue Num]" + actualQueueNumber);
            displayNameString += `${actualQueueNumber + 1}: ${element}\n`;
        });
    }

    // No users message to fill field
    if (displayNameString === "") displayNameString = "None currently."
    //console.log(displayNameString);

    // To make the message of "Page 1/0" with no users not happen
    var moddedLength = groupedArr.length;
    if (moddedLength < 1) moddedLength = 1;
    var moddedPageNum = pageNum;
    if (moddedPageNum < 1) moddedPageNum = 1;
    
    // Creates embed & sends it
    const usersEmbed = new Discord.RichEmbed()
        .setAuthor(client.user.username, client.user.avatarURL)
        .setTitle("Q&A Friday Users")
        .setColor('#FC7A44')
        .setDescription(`If your name is not on here, try disconnecting and reconnecting to <#${process.env.QUEUE_VC}>.\n\nUsers cannot go twice, until the next Q&A Friday! If for some reason a user disconnects and needs to reconnect, it will have to be done by an admin.`)
        .addField(`In Voice Chat (Page ${moddedPageNum}/${moddedLength})`, displayNameString)

    var usersMessage;
    if (!newMessage)
        usersMessage = await message.channel.send({embed: usersEmbed});
    else {
        usersMessage = newMessage;
        await usersMessage.edit({embed: usersEmbed});
    }
    
    // Collector for emotes
    const emotes = ['⬅', '❌', '➡'];
    const collector = usersMessage.createReactionCollector(
        (reaction, user) => emotes.includes(reaction.emoji.name) && user.id !== client.user.id && user.id === message.author.id, { time: 60 * 1000 });
    var react = "";
    var endedOnReact;
    
    // Sends reactions
    if (!newMessage) {
        for (let i = 0; i < emotes.length; i++) {
            const element = emotes[i];
            //console.log(element);
            await usersMessage.react(element);   
        }
    }

    // Collects reactions
    collector.on("collect", async reaction => {
        var user = reaction.users.last();
        react = reaction.emoji.name;
        if (react !== '❌') { reaction.remove(user); }
        endedOnReact = true;
        collector.stop();
    });

    // Clears reactions
    collector.once("end", async collecter => {
        console.log("[Reaction Options] Ended collector, clearing emotes and sending timing out message if needed.");

        if (!endedOnReact) {
            usersMessage.clearReactions();
            
            // Uncomment to enable this
            //message.channel.send(":x: **Timed Out**: The emote reaction request timed out after 15 seconds.");
            return
        }
        if (react === '❌') {
            usersMessage.clearReactions();
            return usersMessage.edit(usersMessage.content);
        }

        var pageNumModifier = 0;
        if (react === emotes[0]) pageNumModifier -= 1;
        if (react === emotes[2]) pageNumModifier += 1;
        //console.log(pageNum + " | " + pageNumModifier);
        sendUsers(message, pageNum + pageNumModifier, usersMessage);
    });
}
// Sends users into chat, with the SANCTUM-ish inventory menu
Sends users into chat, with the SANCTUM-ish inventory menu
Sends users into chat with the SANCTUM - ish inventory menu
async function sendUsers(message, pageNum, newMessage) {
    const listAmount = 2;
    var groupedArr = createGroupedArray(queueVCList, listAmount);
    if (pageNum === undefined) pageNum = 1; else {
        if (pageNum < 1) pageNum = 1;
        if (groupedArr.length < pageNum) pageNum = groupedArr.length;
    }
    if (pageNum > groupedArr.length) {
        if (!groupedArr.length === 0) return;  
    }
    var displayNameString = "";
    if (groupedArr[pageNum - 1]) {
        groupedArr[pageNum - 1].forEach(element => {
            var actualQueueNumber = queueVCList.findIndex(m => m.user.id === element.user.id)
            displayNameString += `${actualQueueNumber + 1}: ${element}\n`;
        });
    }
    if (displayNameString === "") displayNameString = "None currently."
    var moddedLength = groupedArr.length;
    if (moddedLength < 1) moddedLength = 1;
    var moddedPageNum = pageNum;
    if (moddedPageNum < 1) moddedPageNum = 1;
    const usersEmbed = new Discord.RichEmbed()
        .setAuthor(client.user.username, client.user.avatarURL)
        .setTitle("Q&A Friday Users")
        .setColor('#FC7A44')
        .setDescription(`If your name is not on here, try disconnecting and reconnecting to <#${process.env.QUEUE_VC}>.\n\nUsers cannot go twice, until the next Q&A Friday! If for some reason a user disconnects and needs to reconnect, it will have to be done by an admin.`)
        .addField(`In Voice Chat (Page ${moddedPageNum}/${moddedLength})`, displayNameString)
    var usersMessage;
    if (!newMessage)
        usersMessage = await message.channel.send({embed: usersEmbed});
    else {
        usersMessage = newMessage;
        await usersMessage.edit({embed: usersEmbed});
    }
    const emotes = ['⬅', '❌', '➡'];
    const collector = usersMessage.createReactionCollector(
        (reaction, user) => emotes.includes(reaction.emoji.name) && user.id !== client.user.id && user.id === message.author.id, { time: 60 * 1000 });
    var react = "";
    var endedOnReact;
    if (!newMessage) {
        for (let i = 0; i < emotes.length; i++) {
            const element = emotes[i];
            await usersMessage.react(element);   
        }
    }
    collector.on("collect", async reaction => {
        var user = reaction.users.last();
        react = reaction.emoji.name;
        if (react !== '❌') { reaction.remove(user); }
        endedOnReact = true;
        collector.stop();
    });
    collector.once("end", async collecter => {
        console.log("[Reaction Options] Ended collector, clearing emotes and sending timing out message if needed.");
        if (!endedOnReact) {
            usersMessage.clearReactions();
            return
        }
        if (react === '❌') {
            usersMessage.clearReactions();
            return usersMessage.edit(usersMessage.content);
        }
        var pageNumModifier = 0;
        if (react === emotes[0]) pageNumModifier -= 1;
        if (react === emotes[2]) pageNumModifier += 1;
        sendUsers(message, pageNum + pageNumModifier, usersMessage);
    });
}
async function sendUsers ( message , pageNum , newMessage ) { const listAmount = 2 ; var groupedArr = createGroupedArray ( queueVCList , listAmount ) ; if ( pageNum === undefined ) pageNum = 1 ; else { if ( pageNum < 1 ) pageNum = 1 ; if ( groupedArr . length < pageNum ) pageNum = groupedArr . length ; } if ( pageNum > groupedArr . length ) { if ( ! groupedArr . length === 0 ) return ; } var displayNameString = "" ; if ( groupedArr [ pageNum - 1 ] ) { groupedArr [ pageNum - 1 ] . forEach ( element => { var actualQueueNumber = queueVCList . findIndex ( m => m . user . id === element . user . id ) displayNameString += ` ${ actualQueueNumber + 1 } ${ element } \n ` ; } ) ; } if ( displayNameString === "" ) displayNameString = "None currently." var moddedLength = groupedArr . length ; if ( moddedLength < 1 ) moddedLength = 1 ; var moddedPageNum = pageNum ; if ( moddedPageNum < 1 ) moddedPageNum = 1 ; const usersEmbed = new Discord . RichEmbed ( ) . setAuthor ( client . user . username , client . user . avatarURL ) . setTitle ( "Q&A Friday Users" ) . setColor ( '#FC7A44' ) . setDescription ( ` ${ process . env . QUEUE_VC } \n \n ` ) . addField ( ` ${ moddedPageNum } ${ moddedLength } ` , displayNameString ) var usersMessage ; if ( ! newMessage ) usersMessage = await message . channel . send ( { embed : usersEmbed } ) ; else { usersMessage = newMessage ; await usersMessage . edit ( { embed : usersEmbed } ) ; } const emotes = [ '⬅',  ' ', '➡ ' ; const collector = usersMessage . createReactionCollector ( ( reaction , user ) => emotes . includes ( reaction . emoji . name ) && user . id !== client . user . id && user . id === message . author . id , { time : 60 * 1000 } ) ; var react = "" ; var endedOnReact ; if ( ! newMessage ) { for ( let i = 0 ; i < emotes . length ; i ++ ) { const element = emotes [ i ] ; await usersMessage . react ( element ) ; } } collector . on ( "collect" , async reaction => { var user = reaction . users . last ( ) ; react = reaction . emoji . name ; if ( react !== '❌')  { r action.r e move(u s er); } endedOnReact = true ; collector . stop ( ) ; } ) ; collector . once ( "end" , async collecter => { console . log ( "[Reaction Options] Ended collector, clearing emotes and sending timing out message if needed." ) ; if ( ! endedOnReact ) { usersMessage . clearReactions ( ) ; return } if ( react === '❌')  { usersMessage . clearReactions ( ) ; return usersMessage . edit ( usersMessage . content ) ; } var pageNumModifier = 0 ; if ( react === emotes [ 0 ] ) pageNumModifier -= 1 ; if ( react === emotes [ 2 ] ) pageNumModifier += 1 ; sendUsers ( message , pageNum + pageNumModifier , usersMessage ) ; } ) ; }
Sends users into chat, with the SANCTUM-ish inventory menu
Sends users into chat with the SANCTUM - ish inventory menu
//console.log(groupedArr); // Sets a default page num, or makes it human readable // Checks if page number is valid // If it's longer than actual length, but isn't just an empty inventory //console.log(pageNum); // Grabs user in loop, parses it, then adds it to "displayNameString" variable //console.log("[Actual Queue Num]" + actualQueueNumber); // No users message to fill field //console.log(displayNameString); // To make the message of "Page 1/0" with no users not happen // Creates embed & sends it // Collector for emotes // Sends reactions //console.log(element); // Collects reactions // Clears reactions // Uncomment to enable this //message.channel.send(":x: **Timed Out**: The emote reaction request timed out after 15 seconds."); //console.log(pageNum + " | " + pageNumModifier);