diff --git a/index.js b/index.js index 1a459e2..2680aea 100644 --- a/index.js +++ b/index.js @@ -64,6 +64,7 @@ const next_level_message = (level) => { if (level === undefined) { return "The queue is empty."; } + twitch.notLurkingAnymore(level.submitter); // If we pull up a level, we should reset the lurking status if (level.code == "R0M-HAK-LVL") { return "Now playing a ROMhack submitted by " + level.submitter + "."; } else { @@ -77,6 +78,7 @@ const weighted_level_message = (level) => { if (level === undefined) { return "The queue is empty."; } + twitch.notLurkingAnymore(level.submitter); // If we pull up a level, we should reset the lurking status if (level.code == "R0M-HAK-LVL") { return ( "Now playing a ROMhack submitted by " + @@ -352,6 +354,7 @@ async function HandleMessage(message, sender, respond) { } var dip_level = quesoqueue.dip(username); if (dip_level !== undefined) { + twitch.notLurkingAnymore(username); if (dip_level.code == "R0M-HAK-LVL") { respond( "Now playing a ROMhack submitted by " + dip_level.submitter + "." @@ -439,6 +442,7 @@ async function HandleMessage(message, sender, respond) { respond(`@${sender.displayName} ${response}`); } else if (message == "!clear" && sender.isBroadcaster) { quesoqueue.clear(); + twitch.clearLurkers(); respond("The queue has been cleared!"); } else if ( (message.startsWith("!customcode") || message == "!customcodes") && diff --git a/queue.js b/queue.js index bf0d157..584257b 100644 --- a/queue.js +++ b/queue.js @@ -197,6 +197,10 @@ const queue = { return "You can use !remove to kick out someone else's level."; } + // Unlurk the user regardless of whether they're in the queue + // It's unlikely they'll be on BRB and not in the queue, but it's worth protecting against + twitch.notLurkingAnymore(usernameArgument); + var match = queue.matchUsername(usernameArgument); if (!levels.some(match)) { return "No levels from " + usernameArgument + " were found in the queue."; @@ -207,6 +211,7 @@ const queue = { }, remove: (username) => { + twitch.notLurkingAnymore(username); // If a user is leaving, they're not lurking if (current_level != undefined && current_level.submitter == username) { return "Sorry, we're playing that level right now!"; } diff --git a/twitch.js b/twitch.js index c6faec3..8945c3b 100644 --- a/twitch.js +++ b/twitch.js @@ -67,6 +67,10 @@ const twitch = { return false; }, + clearLurkers: () => { + lurkers.clear(); + }, + getWaitTime: async (chatter) => { }