start on 0th page for anime paginations

master
Kit Kasune 3 years ago
parent 85c13d4545
commit e49b609c97
  1. 30
      .idea/workspace.xml
  2. 10
      commands/anime/anime.js
  3. 2
      commands/anime/animeimage.js
  4. 2
      commands/anime/animenick.js
  5. 16
      commands/anime/char.js
  6. 2
      commands/anime/charimage.js
  7. 2
      commands/anime/charnick.js
  8. 6
      commands/anime/haswatched.js
  9. 4
      commands/anime/highvalue.js
  10. 4
      commands/anime/lovechar.js
  11. 2
      commands/anime/watched.js
  12. 4
      commands/anime/watchlist.js

@ -4,13 +4,18 @@
<option name="autoReloadType" value="SELECTIVE" /> <option name="autoReloadType" value="SELECTIVE" />
</component> </component>
<component name="ChangeListManager"> <component name="ChangeListManager">
<list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment=""> <list default="true" id="826c705b-a7fa-4ece-b82a-e278fca7d494" name="Changes" comment="start on 0th page for anime paginations">
<change beforePath="$PROJECT_DIR$/.gitignore" beforeDir="false" afterPath="$PROJECT_DIR$/.gitignore" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commands/anime/anime.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/anime.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commands/anime/animeimage.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/animeimage.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commands/anime/animenick.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/animenick.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commands/anime/char.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/char.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commands/anime/char.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/char.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/util/anime/anisearch.js" beforeDir="false" afterPath="$PROJECT_DIR$/util/anime/anisearch.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commands/anime/charimage.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/charimage.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/util/anime/charsearch.js" beforeDir="false" afterPath="$PROJECT_DIR$/util/anime/charsearch.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commands/anime/charnick.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/charnick.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/util/cache/char.js" beforeDir="false" afterPath="$PROJECT_DIR$/util/cache/char.js" afterDir="false" /> <change beforePath="$PROJECT_DIR$/commands/anime/haswatched.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/haswatched.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commands/anime/highvalue.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/highvalue.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commands/anime/lovechar.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/lovechar.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commands/anime/watched.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/watched.js" afterDir="false" />
<change beforePath="$PROJECT_DIR$/commands/anime/watchlist.js" beforeDir="false" afterPath="$PROJECT_DIR$/commands/anime/watchlist.js" afterDir="false" />
</list> </list>
<option name="SHOW_DIALOG" value="false" /> <option name="SHOW_DIALOG" value="false" />
<option name="HIGHLIGHT_CONFLICTS" value="true" /> <option name="HIGHLIGHT_CONFLICTS" value="true" />
@ -149,7 +154,14 @@
<option name="project" value="LOCAL" /> <option name="project" value="LOCAL" />
<updated>1642539309483</updated> <updated>1642539309483</updated>
</task> </task>
<option name="localTasksCounter" value="6" /> <task id="LOCAL-00006" summary="anime char overload prevention">
<created>1642551387709</created>
<option name="number" value="00006" />
<option name="presentableId" value="LOCAL-00006" />
<option name="project" value="LOCAL" />
<updated>1642551387709</updated>
</task>
<option name="localTasksCounter" value="7" />
<servers /> <servers />
</component> </component>
<component name="TypeScriptGeneratedFilesManager"> <component name="TypeScriptGeneratedFilesManager">
@ -174,6 +186,8 @@
<MESSAGE value="e" /> <MESSAGE value="e" />
<MESSAGE value="list characters in anime" /> <MESSAGE value="list characters in anime" />
<MESSAGE value="extra images now show on char tag add" /> <MESSAGE value="extra images now show on char tag add" />
<option name="LAST_COMMIT_MESSAGE" value="extra images now show on char tag add" /> <MESSAGE value="anime char overload prevention" />
<MESSAGE value="start on 0th page for anime paginations" />
<option name="LAST_COMMIT_MESSAGE" value="start on 0th page for anime paginations" />
</component> </component>
</project> </project>

@ -202,7 +202,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
} else { } else {
await message.channel.send({embeds: [asr.embed]}); await message.channel.send({embeds: [asr.embed]});
} }
@ -220,7 +220,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
} else { } else {
await message.channel.send({embeds: [asr.embed]}); await message.channel.send({embeds: [asr.embed]});
} }
@ -255,7 +255,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;
@ -298,7 +298,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;
@ -361,7 +361,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;

@ -37,7 +37,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;

@ -32,7 +32,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;

@ -83,7 +83,7 @@ module.exports = {
let asr = await ans(message, client, options.anime.trim().toLowerCase(), undefined, 0); let asr = await ans(message, client, options.anime.trim().toLowerCase(), undefined, 0);
if (asr === 0) {return message.channel.send("That search returned no results! Try remaking the character?");} if (asr === 0) {return message.channel.send("That search returned no results! Try remaking the character?");}
else if (asr instanceof Pagination) { else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;
@ -129,7 +129,7 @@ module.exports = {
fn = options.anime; fn = options.anime;
} }
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await dmch.send("React with :white_check_mark: when you've found the anime you want!"); await dmch.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;
@ -256,7 +256,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
} else { } else {
await message.channel.send({embeds: [asr.embed]}); await message.channel.send({embeds: [asr.embed]});
} }
@ -274,7 +274,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
} else { } else {
await message.channel.send({embeds: [asr.embed]}); await message.channel.send({embeds: [asr.embed]});
} }
@ -309,7 +309,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the character you want!"); let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; let arc;
@ -377,7 +377,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the character you want!"); await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; let arc;
@ -486,7 +486,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;
@ -542,7 +542,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the character you want!"); await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; let arc;

@ -37,7 +37,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the character you want!"); await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; let arc;

@ -32,7 +32,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the character you want!"); await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; let arc;

@ -1,5 +1,3 @@
const Discord = require('discord.js');
const AF = require("../../models/anifav"); const AF = require("../../models/anifav");
const AniData = require('../../models/anime'); const AniData = require('../../models/anime');
@ -23,7 +21,7 @@ module.exports = {
help: "Check if you or another user has watched an anime with `{{p}}haswatched`", help: "Check if you or another user has watched an anime with `{{p}}haswatched`",
async execute(message, msg, args, cmd, prefix, mention, client) { async execute(message, msg, args, cmd, prefix, mention, client) {
let user; let user;
if (args[0] && args[0].match(/(?:<@\!?\d+>|\d+)/gm)) { if (args[0] && args[0].match(/<@!?\d+>|\d+/gm)) {
user = message.guild ? (mention || client.users.cache.get(args[0])) : message.author; user = message.guild ? (mention || client.users.cache.get(args[0])) : message.author;
if (!user) {return message.channel.send("Hmmm... for some reason I can't find the user you're looking for?");} if (!user) {return message.channel.send("Hmmm... for some reason I can't find the user you're looking for?");}
args.shift(); args.shift();
@ -38,7 +36,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;

@ -1,5 +1,3 @@
const Discord = require('discord.js');
const UserData = require('../../models/user'); const UserData = require('../../models/user');
const CharData = require('../../models/char'); const CharData = require('../../models/char');
@ -30,7 +28,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the character you want!"); let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; let arc;

@ -46,11 +46,11 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the character you want!"); let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the character you want!");
let arc; 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.");} catch {return message.reply("Looks like you didn't find the character you were looking for.");}
collected = arc.first().emoji.name; collected = arc.first().emoji.name;
if (collected === '✅') { if (collected === '✅') {

@ -58,7 +58,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;

@ -64,7 +64,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); let noticeDel = await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;
@ -111,7 +111,7 @@ module.exports = {
if (asr === 0) { if (asr === 0) {
return message.channel.send("That search returned no results! Try again?"); return message.channel.send("That search returned no results! Try again?");
} else if (asr instanceof Pagination) { } else if (asr instanceof Pagination) {
await asr.start({user: message.author.id, startPage: 1, endTime: 60000}); await asr.start({user: message.author.id, startPage: 0, endTime: 60000});
await asr.message.react('✅'); await asr.message.react('✅');
await message.channel.send("React with :white_check_mark: when you've found the anime you want!"); await message.channel.send("React with :white_check_mark: when you've found the anime you want!");
let arc; let arc;

Loading…
Cancel
Save