From 82bec948ec814f9ec83ed6c669488d24ea3a84a5 Mon Sep 17 00:00:00 2001 From: Timon Date: Tue, 14 Apr 2026 17:55:21 +0200 Subject: [PATCH] Created basic files of the ToDo-List module and added localization strings --- locales/en.json | 62 +++++++ modules/todo-list/commands/todo-list.js | 227 ++++++++++++++++++++++++ modules/todo-list/module.json | 21 +++ 3 files changed, 310 insertions(+) create mode 100644 modules/todo-list/commands/todo-list.js create mode 100644 modules/todo-list/module.json diff --git a/locales/en.json b/locales/en.json index a0637a9..24be3c9 100644 --- a/locales/en.json +++ b/locales/en.json @@ -931,6 +931,36 @@ "owner-cannot-be-renamed": "The owner of the server (%u) cannot be renamed.", "nickname-error": "An error occurred while trying to change the nickname of %u: %e" }, + "guess-the-number": { + "command-description": "Manage guess-the-number sessions", + "status-command-description": "Show the currently running session in this channel", + "create-command-description": "Create a new guess-the-number session", + "create-min-description": "Minimum number of the range", + "create-max-description": "Maximum number of the range", + "create-number-description": "Optional target number (if omitted, a random number is used)", + "end-command-description": "End the currently running session", + "gamechannel-modus": "This command is disabled in game-channel mode.", + "session-not-running": "No active session is running in this channel.", + "session-ended-successfully": "The active session was ended successfully.", + "session-already-running": "A session is already running in this channel.", + "current-session": "Current Session", + "number": "Number", + "min-val": "Minimum", + "max-val": "Maximum", + "owner": "Owner", + "guess-count": "Guess count", + "min-max-discrepancy": "The minimum value must be lower than the maximum value.", + "max-discrepancy": "The selected number cannot be greater than the maximum value.", + "min-discrepancy": "The selected number cannot be lower than the minimum value.", + "created-successfully": "Session created successfully. Number: %n", + "game-started": "Game started", + "game-ended": "Game ended", + "emoji-guide-button": "Meaning of reactions", + "guide-wrong-guess": "Wrong guess", + "guide-win": "Correct guess", + "guide-invalid-guess": "Invalid guess", + "guide-admin-guess": "Guess by an admin" + }, "ping-protection": { "log-not-a-member": "[Ping Protection] Punishment failed: The pinger is not a member.", "log-punish-role-error": "[Ping Protection] Punishment failed: I cannot punish %tag because their role is higher than or equal to my highest role.", @@ -993,5 +1023,37 @@ "label-jump": "Jump to Message", "no-message-link": "This ping was blocked by AutoMod", "list-entry-text": "%index. **Pinged %target** at %time\n%link" + }, + "todo-list": { + "command-todo": "All todo list modules", + "command-todo-add": "Add a new task to your list", + "command-todo-add_name": "Short name of your task", + "command-todo-add_description": "More detailed description of your task", + "command-todo-add_due": "Due point of your task (relative/absolute/timestamp)", + "command-todo-add_reminder": "Reminder for your task (relative/absolute/timestamp)", + "command-todo-add_priority": "Priority of your task", + "command-todo-clear": "Delete certain sections from your list", + "command-todo-clear-all": "Delete all your tasks from your list", + "command-todo-clear-done": "Delete all done tasks from your list", + "command-todo-delete": "Delete a task from your list", + "command-todo-delete_task": "Task that you want to delete", + "command-todo-done": "Mark a task as done", + "command-todo-done_task": "Task that you want to mark as done", + "command-todo-edit": "Edit a task from your list", + "command-todo-edit_task": "Task that you want to edit", + "command-todo-edit_new-name": "New name of your task", + "command-todo-edit_new-description": "New description of your tasks", + "command-todo-edit_new-due": "New due point of your task", + "command-todo-edit_new-reminder": "New reminder for your task", + "command-todo-edit_new-priority": "New priority of your task", + "command-todo-list": "Show all tasks on your list", + "command-todo-list_task": "Filter by name", + "command-todo-list_description": "Filter by description", + "command-todo-list_due": "Filter by due point", + "command-todo-list_reminder": "Filter by reminder", + "command-todo-list_priority": "Filter by priority", + "command-todo-list_status": "Filter by status", + "command-todo-view": "Show a specific task on your list", + "command-todo-view_task": "Task that you want to view" } } diff --git a/modules/todo-list/commands/todo-list.js b/modules/todo-list/commands/todo-list.js new file mode 100644 index 0000000..24f872e --- /dev/null +++ b/modules/todo-list/commands/todo-list.js @@ -0,0 +1,227 @@ +const {localize} = require('../../../src/functions/localize'); + +module.exports.autoComplete = { + "add": { + "priority": async (interaction) => { + value = interaction.value.toLowerCase(); + + interaction.respond(possibleValues); + } + }, + "delete": { + "task": async (interaction) => { + value = interaction.value.toLowerCase(); + + interaction.respond(possibleValues); + } + } +}; + +module.exports.config = { + name: "todo", + description: localize("todo-list", "command-todo"), + usage: "/todo", + type: "slash", + dafualtPermission: false, + options: [ + { + type: "SUB_COMMAND", + name: "add", + description: localize("todo-list", "command-todo-add"), + options: [ + { + type: "STRING", + name: "name", + description: localize("todo-list", "command-todo-add_name"), + required: true, + autocomplete: false + }, + { + type: "STRING", + name: "description", + description: localize("todo-list", "command-todo-add_description"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "due", + description: localize("todo-list", "command-todo-add_due"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "reminder", + description: localize("todo-list", "command-todo-add_reminder"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "priority", + description: localize("todo-list", "command-todo-add_priority"), + required: false, + autocomplete: true + } + ] + }, + { + type: "SUB_COMMAND_GROUP", + name: "clear", + description: localize("todo-list", "command-todo-clear"), + options: [ + { + type: "SUB_COMMAND", + name: "all", + description: localize("todo-list", "command-todo-clear-all") + }, + { + type: "SUB_COMMAND", + name: "done", + description: localize("todo-list", "command-todo-clear-done") + } + ] + }, + { + type: "SUB_COMMAND", + name: "delete", + description: localize("todo-list", "command-todo-delete"), + options: [ + { + type: "STRING", + name: "task", + description: localize("todo-list", "command-todo-delete_task"), + required: true, + autocomplete: true + } + ] + }, + { + type: "SUB_COMMAND", + name: "done", + description: localize("todo-list", "command-todo-done"), + options: [ + { + type: "STRING", + name: "task", + description: localize("todo-list", "command-todo-done_task"), + required: true, + autocomplete: true + } + ] + }, + { + type: "SUB_COMMAND", + name: "edit", + description: localize("todo-list", "command-todo-edit"), + options: [ + { + type: "STRING", + name: "task", + description: localize("todo-list", "command-todo-edit_task"), + required: true, + autocomplete: true + }, + { + type: "STRING", + name: "new-name", + description: localize("todo-list", "command-todo-edit_new-name"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "new-description", + description: localize("todo-list", "command-todo-edit_new-description"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "new-due", + description: localize("todo-list", "command-todo-edit_new-due"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "new-reminder", + description: localize("todo-list", "command-todo-edit_new-reminder"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "new-priority", + description: localize("todo-list", "command-todo-edit_new-priority"), + required: false, + autocomplete: true + } + ] + }, + { + type: "SUB_COMMAND", + name: "list", + description: localize("todo-list", "command-todo-list"), + options: [ + { + type: "STRING", + name: "task", + description: localize("todo-list", "command-todo-list_task"), + required: false, + autocomplete: true + }, + { + type: "STRING", + name: "description", + description: localize("todo-list", "command-todo-list_description"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "due", + description: localize("todo-list", "command-todo-list_due"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "reminder", + description: localize("todo-list", "command-todo-list_reminder"), + required: false, + autocomplete: false + }, + { + type: "STRING", + name: "priority", + description: localize("todo-list", "command-todo-list_priority"), + required: false, + autocomplete: true + }, + { + type: "STRING", + name: "status", + description: localize("todo-list", "command-todo-list_status"), + required: false, + autocomplete: true + } + ] + }, + { + type: "SUB_COMMAND", + name: "view", + description: localize("todo-list", "command-todo-view"), + options: [ + { + type: "STRING", + name: "task", + description: localize("todo-list", "command-todo-view_task"), + required: true, + autocomplete: true + } + ] + } + ] +}; \ No newline at end of file diff --git a/modules/todo-list/module.json b/modules/todo-list/module.json new file mode 100644 index 0000000..186e513 --- /dev/null +++ b/modules/todo-list/module.json @@ -0,0 +1,21 @@ +{ + "name": "todo-list", + "author": { + "name": "Timon", + "link": "https://github.com/Timon611", + "scnxOrgID": "133" + }, + "openSourceURL": "https://github.com/Timon611/CustomDCBot/tree/main/modules/todo-list", + "commands-dir": "/commands", + "tags": [ + "community" + ], + "humanReadableName": { + "en": "ToDo-Lists", + "de": "ToDo-Listen" + }, + "description": { + "en": "", + "de": "" + } +} \ No newline at end of file