diff --git a/.idea/discord.xml b/.idea/discord.xml
index 30bab2a..d8e9561 100644
--- a/.idea/discord.xml
+++ b/.idea/discord.xml
@@ -1,7 +1,7 @@
-
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
index cf9a294..31cc396 100644
--- a/.idea/workspace.xml
+++ b/.idea/workspace.xml
@@ -5,16 +5,11 @@
-
-
-
-
-
-
-
-
+
+
+
@@ -24,6 +19,17 @@
+
+
+
+
+
+
+
+
+
+
+
@@ -34,14 +40,16 @@
+
+
-
+
@@ -50,8 +58,8 @@
-
+
@@ -65,6 +73,9 @@
1628567777733
+
+
+
diff --git a/commands/anime/anime.js b/commands/anime/anime.js
index 97110b8..27bfeb1 100644
--- a/commands/anime/anime.js
+++ b/commands/anime/anime.js
@@ -80,7 +80,7 @@ module.exports = {
options.name = await ask(mesg, "What is the anime's name?", 60000, true); if (!options.name) {return;}
if (options.name.length > 75) {clearDM(); return dmch.send("The anime name can't be more than 75 characters!");}
- options.plot = await ask(mesg, "How would you describe the anime? Give a very brief description of things like its plot, main characters, and setting.", 240000, true); if (!options.plot) {return clearDM();;}
+ options.plot = await ask(mesg, "How would you describe the anime? Give a very brief description of things like its plot, main characters, and setting.", 240000, true); if (!options.plot) {return clearDM();}
if (options.plot.length > 500) {clearDM(); return dmch.send("Oi! I said give a \"very brief\" description of the anime!");}
options.japname = await ask(mesg, "What is the anime's japanese name? (The romanization, not the Japanese characters.)", 120000, true); if (!options.japname) {return clearDM();}
@@ -259,7 +259,7 @@ module.exports = {
await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc;
- try {arc = await asr.message.awaitReactions({filter: (r, u) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
+ try {arc = await asr.message.awaitReactions({filter: (r) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
catch {return message.reply("Looks like you didn't find the anime you were looking for.");}
collected = arc.first().emoji.name;
if (collected === '✅') {
diff --git a/commands/anime/char.js b/commands/anime/char.js
index 01811f3..afa90d0 100644
--- a/commands/anime/char.js
+++ b/commands/anime/char.js
@@ -81,6 +81,7 @@ module.exports = {
if (options.anime.length > 75) {clearDM(); return dmch.send("The anime name can't be more than 75 characters!");}
if (options.anime.trim().toLowerCase() === 'none') {options.anime = null;}
else {
+ let fn;
let asr = await ans(mesg, client, options.anime.trim().toLowerCase());
if (asr === 0) {
let conf = await ask(mesg, "That search returned no results. Would you like me to put the anime you specified down anyways? Otherwise, I'll abandon this process, and we can try again.", 60000, true);
@@ -98,9 +99,9 @@ module.exports = {
await asr.message.react('✅');
await dmch.send("React with :white_check_mark: when you've found the anime you want!");
let arc;
- try {arc = await asr.message.awaitReactions({filter: (r, u) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
+ try {arc = await asr.message.awaitReactions({filter: (r) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
catch {return dmch.send("Looks like you didn't find the anime you were looking for, so I went ahead and ended the character creation for you.");}
- collected = arc.first().emoji.name;
+ let collected = arc.first().emoji.name;
if (collected === '✅') {
fn = client.misc.cache.anime.get(asr.getCurrentPage().title.trim());
asr.stop();
@@ -254,7 +255,7 @@ module.exports = {
await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc;
- try {arc = await asr.message.awaitReactions({filter: (r, u) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
+ try {arc = await asr.message.awaitReactions({filter: (r) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
catch {return message.reply("Looks like you didn't find the character you were looking for.");}
collected = arc.first().emoji.name;
if (collected === '✅') {
@@ -314,7 +315,7 @@ module.exports = {
await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc;
- try {arc = await asr.message.awaitReactions({filter: (r, u) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
+ try {arc = await asr.message.awaitReactions({filter: (r) => ['✅', '⏹'].includes(r.emoji.name), max: 1, errors: ['time']});}
catch {return message.reply("Looks like you didn't find the character you were looking for.");}
collected = arc.first().emoji.name;
if (collected === '✅') {
@@ -346,7 +347,7 @@ module.exports = {
args = tempchar.split(/\s+/g);
}
let img = args.join(" ");
- if (!img.match(/^https:\/\/(?:[\w\-].?)+[\/\w\-\%\(\)_]+\.(?:png|jpg|jpeg|gif|webp)$/gm)) {return message.channel.send("I don't think that's an image. Try again?");}
+ if (!img.match(/^https:\/\/(?:[\w\-].?)+[\/\w\-%()_]+\.(?:png|jpg|jpeg|gif|webp)$/gm)) {return message.channel.send("I don't think that's an image. Try again?");}
if (!queue) {
ch.images.push(img);
ch.markModified('images');
diff --git a/util/anime/anisearch.js b/util/anime/anisearch.js
index a07cd49..08f6b40 100644
--- a/util/anime/anisearch.js
+++ b/util/anime/anisearch.js
@@ -12,10 +12,6 @@ module.exports = async (message, client, search, threshold=-10000, type='full')
if (da.includes(client.misc.cache.anime.get(ani))) {return 0;}
let an = ani.plot ? ani : await Ani.findOne({id: client.misc.cache.anime.get(ani)});
let chs = [];
- for (let i = 0; i < an.characters.length; i++) {
- let tch = await Char.findOne({id: an.characters[i]});
- if (tch) {chs.push(tch.name);}
- }
let rte = new Discord.MessageEmbed()
.setTitle(an.name)
.setAuthor('Anime Search', message.author.avatarURL())
@@ -29,7 +25,7 @@ module.exports = async (message, client, search, threshold=-10000, type='full')
.addField('Description', an.plot)
.addField('Length', `**# of Seasons:** ${an.seasons}\n**# of Episodes:** ${an.episodes}`)
.addField('Airing', `**Began:** ${an.airStartDate}\n**Ended:** ${an.isComplete ? an.airEndDate : 'This anime is still airing!'}`)
- .addField('Other', `**Genre(s):** ${an.genres.join(", ")}\n**Tags:** ${an.tags.join(", ")}\n**Characters:** ${chs.join(", ")}\n**Stream this at:** ${an.streamAt.join(", ")}`)
+ .addField('Other', `**Genre(s):** ${an.genres.join(", ")}\n**Tags:** ${an.tags.join(", ")}\n**Characters:** ${an.characters.map(char => client.misc.cache.charsID.get(char)).join(', ')}\n**Stream this at:** ${an.streamAt.join(", ")}`)
}
da.push(an.id);
return {embed: rte, id: an.id};