changed configs and bug fixes

added task content empty
fixed responses
changed configs
This commit is contained in:
liyunze
2023-03-23 12:40:16 +08:00
parent f62ca92fba
commit 81bb5eb3a9
2 changed files with 14 additions and 8 deletions
+6 -4
View File
@@ -197,7 +197,6 @@ const configs = (function () {
"!clear",
];
// TODO ADD GITHUB README TO HELP COMMAND
// Responses
const taskAdded = 'The task "{task}" has been added, {user}!';
const noTaskAdded = 'Looks like you already have "{task}" up there {user}';
@@ -214,10 +213,13 @@ const configs = (function () {
const notMod = "Permission denied, {user}; Mods only";
const clearedAll = "All tasks have been cleared";
const clearedDone = "All finished tasks have been cleared";
const ryanpython =
"{user} RyanPython is the creator of this bot, check out his Twitch at https://www.twitch.tv/ryanpython";
const help = `{user} Use the following commands to help you out - !task !remove !edit !done. For more commands, click here: https://github.com/liyunze-coding/Chat-Task-Tic-Overlay#commands`;
const additionalCommands = {
"!ryanpython":
"{user} RyanPython is the creator of this bot, check out his Twitch at https://www.twitch.tv/ryanpython",
};
// Other
const styles = {
headerFontFamily,
@@ -294,6 +296,7 @@ const configs = (function () {
adminDeleteCommands,
adminClearDoneCommands,
adminClearAllCommands,
additionalCommands,
};
const responses = {
@@ -311,7 +314,6 @@ const configs = (function () {
notMod,
help,
adminDeleteTasks,
ryanpython,
clearedAll,
clearedDone,
};
+8 -4
View File
@@ -27,6 +27,11 @@ ComfyJS.onCommand = (user, command, message, flags, extra) => {
} else if (commands.addTaskCommands.includes(command)) {
// ADD TASK
if (message === "") {
// check if message is empty
return respond(responseTemplates.noTaskContent, user);
}
if (checkUserTask(user)) {
// check if user has a task pending
return respond(responseTemplates.noTaskAdded, user);
@@ -63,7 +68,7 @@ ComfyJS.onCommand = (user, command, message, flags, extra) => {
if (!checkUserTask(user)) {
// check if user has a task pending
return respond(responseTemplates.noTask, user);
return respond(responseTemplates.noTaskToEdit, user);
}
editTask(user, message);
@@ -117,14 +122,13 @@ ComfyJS.onCommand = (user, command, message, flags, extra) => {
}
adminDeleteTask(message);
respond(responseTemplates.adminDeleteTasks, user, message);
} else if (command === "!ryanpython") {
respond(responseTemplates.ryanpython, user);
} else if (commands.helpCommands.includes(command)) {
respond(responseTemplates.help, user);
} else if (commands.additionalCommands[command]) {
respond(commands.additionalCommands[command], user);
} else {
// command not found
}
};
// ComfyJS.Init("RyanPython");
ComfyJS.Init(auth.username, `oauth:${auth.oauth}`, [auth.channel]);