master
Kit Kasune 4 years ago
parent 610c79e70e
commit b8214e2f96
  1. 16
      commands/anime/anime.js
  2. 10
      commands/dev/blacklist.js
  3. 8
      commands/utility/todo.js

@ -1,10 +1,12 @@
const {TagFilter} = require("../../util/tagfilter");
const {Tag} = require ("../../util/tag");
const Discord = require('discord.js'); const Discord = require('discord.js');
const UserData = require('../../models/user'); const UserData = require('../../models/user');
const AniData = require('../../models/anime'); const AniData = require('../../models/anime');
const {TagFilter} = require("../../util/tagfilter");
const {Tag} = require ("../../util/tag");
const ask = require('../../util/ask');
module.exports = { module.exports = {
name: "anime", name: "anime",
aliases: ['ani', 'an'], 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.");} 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'); 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.");}); .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() message.channel.send(new Discord.MessageEmbed()

@ -52,7 +52,7 @@ module.exports = {
if (['u', 'user'].includes(args[0].toLowerCase())) { if (['u', 'user'].includes(args[0].toLowerCase())) {
args.shift(); 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) { 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;} 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 (bu.developer) {message.channel.send("Developers cannot be blacklisted!"); return null;}
} }
if (['a', 'add'].includes(args[1].toLowerCase())) { if (['a', 'add'].includes(args[0].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; 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!");} if (!blacklistUser) {return message.reply("You must specify a user to blacklist!");}
let usersData = await UserData.findOne( { uid: blacklistUser } ) || new UserData({uid: blacklistUser}); 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!`) 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())) { if (['r', 'rem', 'remove', 'd', 'del', 'delete'].includes(args[0].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; 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..." );} 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}); let userData = await UserData.findOne( { uid: blacklistedUser } ) || new UserData({uid: blacklistedUser});

@ -25,7 +25,7 @@ module.exports = {
let td = await TD.findOne({uid: message.author.id}); 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.");} if (td && td.lists.quick.length > 20) {return message.channel.send("Sorry, but your list can only have 20 items or less.");}
let item; 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(" ");} else {args.shift(); item = args.join(" ");}
if (item.length > 100) {return message.channel.send("ToDo items can only be less than 100 characters.");} 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}); td = td || new TD({uid: message.author.id});
@ -56,5 +56,11 @@ module.exports = {
.setTimestamp() .setTimestamp()
); );
} }
else if (['d', 'delete', 'r', 'remove'].includes(args[0].toLowerCase())) {
}
else {return message.channel.send("Invalid arg! Use `<add|list|delete|edit|view|complete|uncomplete>`");}
} }
}; };
Loading…
Cancel
Save