.setDescription("Create and manage your To-Do lists. You can use the commands like `add` or `view` without specifying a list to see your `quick` list, which is just quick random stuff. Otherwise, you can specify a list name first to manage it.")
if(!args.length){returnmessage.channel.send(`List syntax: \`${prefix}todo list <create|delete|list|listName>\`. Use your list's name and then \`<add|list|delete|edit|view|complete|uncomplete>\` to manage the list's items.`);}
if(args[0].toLowerCase()==='quick'){returnmessage.channel.send(`To manage your personal quick list, please use the list syntax without \`list quick\` added. (Use \`${prefix}help todo\` for help.)`);}
if(td&&Object.keys(td.lists).length===10){returnmessage.channel.send("Sorry, but you've reached the maximum list count of 10. Delete some lists you've completed... or get off your bum and maybe start checking off some items? :eyes:");}
letln;
if(!args[1]){
ln=awaitask(message,"What would you like your list's name to be? This question will time out in 30s",60000);
if(!ln){returnmessage.channel.send("This question has timed out.");}
}else{ln=args[1].trim().toLowerCase();}
if(ln.length>15){returnmessage.channel.send("List names must be 15 characters or less.");}
if(!ln.match(/^[a-z-]+$/gm)){returnmessage.channel.send("List names must contain only letters and hyphens.");}
if(['create','c','n','new','a','add','d','delete','r','remove','l','list','e','edit','v','view','comp','complete','uc','uncomp','uncomplete'].includes(ln)){returnmessage.channel.send("That list name is invalid as it is used for the functionality of this command.");}
if(ln==='quick'){returnmessage.channel.send("You cannot use that name as it is used for your personal list.");}
if(td&&td.lists[ln]){returnmessage.channel.send("You already have a list with that name.");}
.setDescription(`You now have **${Object.keys(td.lists).length}** lists (including your personal list) with a total of **${totalItems} items**.`)
.addField("Managing",`-To add to your new list, use \`${prefix}todo list ${ln} add\`.\n-To view its items, use \`${prefix}todo list ${ln} view\`.\n-To delete this list, use \`${prefix}todo list delete ${ln}\`.`)
catch{returnmessage.channel.send("This question has timed out. Please try again!");}
ln=collected.first().content.trim();
}else{ln=args[1].trim().toLowerCase();}
if(!td.lists[ln]){returnmessage.channel.send("You don't have a list that matches that name!");}
deletetd.lists[ln];
td.markModified(`lists.${ln}`);
awaittd.save();
letnum=Math.ceil(Math.random()*10);
returnmessage.channel.send(num===5
?"I've successfully yeeted that list off the face of the planet for you!"
:["Good riddance! I've removed that list for you.","Spring cleanup! That list is gone.","That's a whole chunk of stuff you don't gotta worry about anymore. I've made sure of that.","Fear not, I've made sure that list won't bug you anymore."][Math.floor(Math.random()*4)]
}else{returnmessage.channel.send("Valid `list` args: `<create|delete|list|listName>`. If you tried to specify a list name, it may not exist or you don't have any lists.");}
if(!items.length){message.channel.send(`What would you like to add to your \`${list}\` list? You're in multiple addition mode, which means you can keep adding items to your list until you say 'done'. To add a new item, just send it in a message.`);}
.setDescription(`In ${list==='quick'?"your personal quick list":`list \`${list}\``}\n- ${items.join('\n- ')}`)
.setColor('c375f0');
if(reachedMax){resembed.addField("Notice","The list addition process was automatically stopped because your list reached the maximum limit of 25 items.");}
returnmessage.channel.send("There was an error displaying your list. It might have too many characters. This bug has been reported to the developers and will be fixed soon! Join the support server for updates.");
returnmessage.channel.send(["That's one item off the list for ya!","And another one bites the dust! I've removed that item from your todo list.","And thus the list grows one item smaller!"][Math.floor(Math.random()*3)]);
}catch{returnmessage.channel.send("There seemed to have been a problem deleting that list item. Contact my devs if the problem persists.");}