Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed "!lockskip <reason>" Cycle not locks #104

Closed
wants to merge 1 commit into from
Closed
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
54 changes: 46 additions & 8 deletions basicBot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2598,6 +2598,7 @@
if (this.type === 'exact' && chat.message.length !== cmd.length) return void (0);
if (!basicBot.commands.executable(this.rank, chat)) return void (0);
else {
$.getJSON('https://stg.plug.dj/_/rooms/state', function(data) {
if (basicBot.room.skippable) {
var dj = API.getDJ();
var id = dj.id;
Expand All @@ -2607,7 +2608,22 @@

if (chat.message.length === cmd.length) {
API.sendChat(subChat(basicBot.chat.usedlockskip, {name: chat.un}));
basicBot.roomUtilities.booth.lockBooth();

if (data.data[0].booth.shouldCycle) {
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
setTimeout(function () {
basicBot.room.skippable = true
}, 5 * 1000);
setTimeout(function (id) {
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
}, 1500, id);
}, 1000, id);

}else if (!data.data[0].booth.shouldCycle) {
basicBot.roomUtilities.changeDJCycle();
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
Expand All @@ -2618,25 +2634,42 @@
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
setTimeout(function () {
basicBot.roomUtilities.booth.unlockBooth();
basicBot.roomUtilities.changeDJCycle();
}, 1000);
}, 1500, id);
}, 1000, id);
}

return void (0);
}
var validReason = false;
var msg = chat.message;
var reason = msg.substring(cmd.length + 1);
for (var i = 0; i < basicBot.settings.lockskipReasons.length; i++) {
var r = basicBot.settings.lockskipReasons[i][0];
for (var i = 0; i < basicBot.settings.skipReasons.length; i++) {
var r = basicBot.settings.skipReasons[i][0];
if (reason.indexOf(r) !== -1) {
validReason = true;
msgSend += basicBot.settings.lockskipReasons[i][1];
msgSend += basicBot.settings.skipReasons[i][1];
}
}
if (validReason) {
API.sendChat(subChat(basicBot.chat.usedlockskip, {name: chat.un}));
basicBot.roomUtilities.booth.lockBooth();
if (data.data[0].booth.shouldCycle) {
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
API.sendChat(msgSend);
setTimeout(function () {
basicBot.room.skippable = true
}, 5 * 1000);
setTimeout(function (id) {
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
}, 1500, id);
}, 1000, id);

}else {
basicBot.roomUtilities.changeDJCycle();
setTimeout(function (id) {
API.moderateForceSkip();
basicBot.room.skippable = false;
Expand All @@ -2648,15 +2681,20 @@
basicBot.userUtilities.moveUser(id, basicBot.settings.lockskipPosition, false);
basicBot.room.queueable = true;
setTimeout(function () {
basicBot.roomUtilities.booth.unlockBooth();
basicBot.roomUtilities.changeDJCycle();
}, 1000);
}, 1500, id);
}, 1000, id);

}


return void (0);
}
}
});
}
}
}
},

locktimerCommand: {
Expand Down