From d8df9b2ca1ce5aab3659895f51a4a4205bb358de Mon Sep 17 00:00:00 2001
From: liyunze <50455574+liyunze-coding@users.noreply.github.com>
Date: Fri, 5 Jul 2024 21:53:23 +1000
Subject: [PATCH] update no chat version
---
index.html | 13 +------
scripts/index.js | 89 ------------------------------------------------
2 files changed, 1 insertion(+), 101 deletions(-)
delete mode 100644 scripts/index.js
diff --git a/index.html b/index.html
index 08b54cd..8114436 100644
--- a/index.html
+++ b/index.html
@@ -9,7 +9,6 @@
-
@@ -24,17 +23,7 @@
0/0
diff --git a/scripts/index.js b/scripts/index.js
deleted file mode 100644
index c29a420..0000000
--- a/scripts/index.js
+++ /dev/null
@@ -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);
- }
- }
-};