From b8214e2f9608dae9fe7e37c386ba8611383db00a Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Thu, 4 Mar 2021 18:03:29 -0700 Subject: [PATCH] sync --- commands/anime/anime.js | 16 ++++++++++++---- commands/dev/blacklist.js | 10 +++++----- commands/utility/todo.js | 8 +++++++- 3 files changed, 24 insertions(+), 10 deletions(-) diff --git a/commands/anime/anime.js b/commands/anime/anime.js index 0227d41..1ce10bc 100644 --- a/commands/anime/anime.js +++ b/commands/anime/anime.js @@ -1,10 +1,12 @@ -const {TagFilter} = require("../../util/tagfilter"); -const {Tag} = require ("../../util/tag"); - const Discord = require('discord.js'); + const UserData = require('../../models/user'); const AniData = require('../../models/anime'); +const {TagFilter} = require("../../util/tagfilter"); +const {Tag} = require ("../../util/tag"); +const ask = require('../../util/ask'); + module.exports = { name: "anime", aliases: ['ani', 'an'], @@ -57,9 +59,15 @@ module.exports = { if (client.misc.activeDMs.has(message.author.id)) {return message.channel.send("I'm already asking you questions in a DM! Finish that first, then try this command again.");} client.misc.activeDMs.set(message.author.id, 'anime-add'); - await message.author.send("I'm going to ask you some questions about the anime's info. Just reply with the answer and use good grammar and spelling and be as accurate as possible. To cancel the process, just leave the question unanswered for a few minutes and I'll let you know that the question timed out and is not longer answerable.") + let mesg = await message.author.send("I'm going to ask you some questions about the anime's info. Just reply with the answer and use good grammar and spelling and be as accurate as possible. To cancel the process, just leave the question unanswered for a few minutes and I'll let you know that the question timed out and is not longer answerable.") .catch(() => {return message.reply("Something went wrong there! Most likely, your DMs are closed.");}); + await mesg.channel.send("Check your DMs!"); + let options = {}; + + function clearDM() {client.misc.activeDMs.delete(message.author.id);} + client.misc.activeDMs.set(message.author.id, 'anime-make'); + let dmch = mesg.channel; } message.channel.send(new Discord.MessageEmbed() diff --git a/commands/dev/blacklist.js b/commands/dev/blacklist.js index e0138d1..34aadd6 100644 --- a/commands/dev/blacklist.js +++ b/commands/dev/blacklist.js @@ -52,7 +52,7 @@ module.exports = { if (['u', 'user'].includes(args[0].toLowerCase())) { args.shift(); - if (!args[1]) {return message.channel.send("You must specify whether to `add` or `del` a user's blacklist!");} + if (!args[0]) {return message.channel.send("You must specify whether to `add` or `del` a user's blacklist!");} function checkPerms(tu, bu) { if (!tu.developer && bu.support) {message.channel.send("You can't blacklist any member of staff unless you're a developer!"); return null;} @@ -60,8 +60,8 @@ module.exports = { if (bu.developer) {message.channel.send("Developers cannot be blacklisted!"); return null;} } - if (['a', 'add'].includes(args[1].toLowerCase())) { - let blacklistUser = args[0].match(/^<@(?:!?)(?:\d+)>$/) && mention && client.users.cache.has(mention.id) ? mention.id : client.users.cache.has(args[0]) ? client.users.cache.get(args[0]).id : null; + if (['a', 'add'].includes(args[0].toLowerCase())) { + let blacklistUser = args[1].match(/^<@(?:!?)(?:\d+)>$/) && mention && client.users.cache.has(mention.id) ? mention.id : client.users.cache.has(args[1]) ? client.users.cache.get(args[1]).id : null; if (!blacklistUser) {return message.reply("You must specify a user to blacklist!");} let usersData = await UserData.findOne( { uid: blacklistUser } ) || new UserData({uid: blacklistUser}); @@ -75,8 +75,8 @@ module.exports = { return message.channel.send(`Another one bites the dust! **${blacklistUser.user.tag}** has been blacklisted!`) } - if (['r', 'rem', 'remove', 'd', 'del', 'delete'].includes(args[1].toLowerCase())) { - let blacklistedUser = args[0].match(/^<@(?:!?)(?:\d+)>$/) && mention && client.users.cache.has(mention.id) ? mention.id : client.users.cache.has(args[0]) ? client.users.cache.get(args[0]).id : null; + if (['r', 'rem', 'remove', 'd', 'del', 'delete'].includes(args[0].toLowerCase())) { + let blacklistedUser = args[1].match(/^<@(?:!?)(?:\d+)>$/) && mention && client.users.cache.has(mention.id) ? mention.id : client.users.cache.has(args[1]) ? client.users.cache.get(args[1]).id : null; if (!blacklistedUser) { return message.reply("You need to specify who you're letting free..." );} let userData = await UserData.findOne( { uid: blacklistedUser } ) || new UserData({uid: blacklistedUser}); diff --git a/commands/utility/todo.js b/commands/utility/todo.js index fdfcd3a..dfce051 100644 --- a/commands/utility/todo.js +++ b/commands/utility/todo.js @@ -25,7 +25,7 @@ module.exports = { let td = await TD.findOne({uid: message.author.id}); if (td && td.lists.quick.length > 20) {return message.channel.send("Sorry, but your list can only have 20 items or less.");} let item; - if (!args[1]) {item = await ask(message, "What would you like to your quick list?", 90000); if (!item) {return;}} + if (!args[1]) {item = await ask(message, "What would you like to add to your quick list?", 90000); if (!item) {return;}} else {args.shift(); item = args.join(" ");} if (item.length > 100) {return message.channel.send("ToDo items can only be less than 100 characters.");} td = td || new TD({uid: message.author.id}); @@ -56,5 +56,11 @@ module.exports = { .setTimestamp() ); } + + else if (['d', 'delete', 'r', 'remove'].includes(args[0].toLowerCase())) { + + } + + else {return message.channel.send("Invalid arg! Use ``");} } }; \ No newline at end of file