mirror of
https://github.com/liyunze-coding/Chat-Task-Tic-Overlay.git
synced 2026-08-24 10:04:00 -05:00
changed configs and bug fixes
added task content empty fixed responses changed configs
This commit is contained in:
+6
-4
@@ -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
@@ -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]);
|
||||
|
||||
Reference in New Issue
Block a user