update no chat version
This commit is contained in:
parent
72da262759
commit
d8df9b2ca1
2 changed files with 1 additions and 101 deletions
13
index.html
13
index.html
|
|
@ -9,7 +9,6 @@
|
||||||
|
|
||||||
<script src="./configs.js"></script>
|
<script src="./configs.js"></script>
|
||||||
<script defer src="scripts/defaultConfigs.js"></script>
|
<script defer src="scripts/defaultConfigs.js"></script>
|
||||||
<script defer src="scripts/index.js"></script>
|
|
||||||
<script defer src="scripts/taskList.js"></script>
|
<script defer src="scripts/taskList.js"></script>
|
||||||
|
|
||||||
<link rel="stylesheet" type="text/css" href="styles/taskList.css" />
|
<link rel="stylesheet" type="text/css" href="styles/taskList.css" />
|
||||||
|
|
@ -24,17 +23,7 @@
|
||||||
<div class="task-count">0/0</div>
|
<div class="task-count">0/0</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="task-wrapper">
|
<div class="task-wrapper">
|
||||||
<div class="task-container primary">
|
<div class="task-container primary"></div>
|
||||||
<!--
|
|
||||||
<div class="task">
|
|
||||||
<div class="username">RyanPython</div>
|
|
||||||
<ol class="user-tasks">
|
|
||||||
<li class="todo">complete website</li>
|
|
||||||
<li class="todo">work on overlay</li>
|
|
||||||
</ol>
|
|
||||||
</div>
|
|
||||||
-->
|
|
||||||
</div>
|
|
||||||
<div class="task-container secondary"></div>
|
<div class="task-container secondary"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,89 +0,0 @@
|
||||||
const commands = configs.commands;
|
|
||||||
const responses = configs.responses;
|
|
||||||
|
|
||||||
let params = {};
|
|
||||||
|
|
||||||
function isMod(flags) {
|
|
||||||
return flags.broadcaster || flags.mod;
|
|
||||||
}
|
|
||||||
|
|
||||||
function isStreamer(flags) {
|
|
||||||
return flags.broadcaster;
|
|
||||||
}
|
|
||||||
|
|
||||||
ComfyJS.onCommand = (user, command, message, flags, extra) => {
|
|
||||||
command = `!${command.toLowerCase()}`;
|
|
||||||
|
|
||||||
if (commands.addTaskCommands.includes(command)) {
|
|
||||||
addTask(user, extra.userColor, message);
|
|
||||||
} else if (commands.editTaskCommands.includes(command)) {
|
|
||||||
return editTask(user, message);
|
|
||||||
} else if (commands.deleteTaskCommands.includes(command)) {
|
|
||||||
removeTask(user, message);
|
|
||||||
} else if (commands.finishTaskCommands.includes(command)) {
|
|
||||||
if (message === "all") {
|
|
||||||
return markAllTasksAsDone(user);
|
|
||||||
}
|
|
||||||
|
|
||||||
return markTaskDone(user, message);
|
|
||||||
} else if (commands.unfinishTaskCommands.includes(command)) {
|
|
||||||
markTaskUndone(user, message);
|
|
||||||
} else if (commands.adminDeleteCommands.includes(command)) {
|
|
||||||
if (!isMod(flags)) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
let mentioned = message.replace("@", "");
|
|
||||||
|
|
||||||
if (mentioned === "") {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
clearUserTasks(mentioned);
|
|
||||||
} else if (commands.focusTaskCommands.includes(command)) {
|
|
||||||
let focusRequest = focusTask(user, message);
|
|
||||||
|
|
||||||
if (focusRequest.status !== 200) {
|
|
||||||
respond(focusRequest.body.error, params);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// task focused
|
|
||||||
let focusedResponse = responses.taskFocused;
|
|
||||||
|
|
||||||
params.task = focusRequest.body.focusedTask;
|
|
||||||
|
|
||||||
respond(focusedResponse, params);
|
|
||||||
} else if (commands.unfocusTaskCommands.includes(command)) {
|
|
||||||
let unfocusRequest = unfocusTask(user);
|
|
||||||
|
|
||||||
if (unfocusRequest.status !== 200) {
|
|
||||||
respond(unfocusRequest.body.error, params);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// task unfocused
|
|
||||||
let unfocusedResponse = responses.taskUnfocused;
|
|
||||||
|
|
||||||
respond(unfocusedResponse, params);
|
|
||||||
} else if (commands.adminClearDoneCommands.includes(command)) {
|
|
||||||
if (!isStreamer(flags)) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
clearAllDoneTasks();
|
|
||||||
}
|
|
||||||
} else if (commands.adminClearAllCommands.includes(command)) {
|
|
||||||
if (!isStreamer(flags)) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
clearAllTasks();
|
|
||||||
}
|
|
||||||
} else if (commands.clearMyDoneCommands.includes(command)) {
|
|
||||||
clearOwnDoneTasks(user);
|
|
||||||
} else if (commands.adminClearNotStreamerCommands.includes(command)) {
|
|
||||||
if (!isStreamer(flags)) {
|
|
||||||
return;
|
|
||||||
} else {
|
|
||||||
clearAllExceptStreamer(auth.channel);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
};
|
|
||||||
Loading…
Reference in a new issue