Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 " +
Expand Down Expand Up @@ -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 + "."
Expand Down Expand Up @@ -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") &&
Expand Down
5 changes: 5 additions & 0 deletions queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,10 @@ const queue = {
return "You can use !remove <username> 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.";
Expand All @@ -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!";
}
Expand Down
4 changes: 4 additions & 0 deletions twitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,10 @@ const twitch = {
return false;
},

clearLurkers: () => {
lurkers.clear();
},

getWaitTime: async (chatter) => {

}
Expand Down