Hello, I have a (minor) issue with a command that tells how many songs each DJ has left to play. It is supposed to change the output dependent on whether or not the room is being enforced. When the song limit is turned on, it is supposed to say how many songs are left,
Example: "username" (0 song(s) left)
And when the limit is turned off, it is just supposed to say how many plays each DJ is sitting at.
Example: "username" (played 0)
I have attached the code for the command, and am curious if anyone can help. Thank you :)
exports.name = 'djinfo';
exports.hidden = false;
exports.enabled = true;
exports.matchStart = false;
exports.matchRegex = false;
exports.aliases = Array('counts');
exports.categories = Array('moderators');
exports.help = 'Information about how many songs each DJ has left to play for room enforcement rules.';
exports.handler = function(data) {
if (config.enforcement.enforceroom) {
var response = '';
for (i in djs) {
response += usersList[djs[i].id].name + ' (' + djs[i].remaining + ' song(s) left), ';
}
output({text: response.substring(0, response.length - 2), destination: data.source, userid: data.userid});
} else {
var response = '';
for (i in djs) {
response += usersList[djs[i].id].name + ' (played ' + djs[i].remaining + '), ';
}
output({text: response.substring(0, response.length - 2), destination: data.source, userid: data.userid});
}
return true;
}
Hello, I have a (minor) issue with a command that tells how many songs each DJ has left to play. It is supposed to change the output dependent on whether or not the room is being enforced. When the song limit is turned on, it is supposed to say how many songs are left,
Example: "username" (0 song(s) left)
And when the limit is turned off, it is just supposed to say how many plays each DJ is sitting at.
Example: "username" (played 0)
I have attached the code for the command, and am curious if anyone can help. Thank you :)