From 50aa98e5d74fc9ba8f93b87d8ddc090bf821b151 Mon Sep 17 00:00:00 2001 From: WubzyGD Date: Fri, 23 Oct 2020 22:58:58 -0600 Subject: [PATCH] Begin work on anime command; added anime schema --- commands/anime.js | 32 ++++++++++++++++++++++++++++++++ models/anime.js | 7 ++++++- 2 files changed, 38 insertions(+), 1 deletion(-) create mode 100644 commands/anime.js diff --git a/commands/anime.js b/commands/anime.js new file mode 100644 index 0000000..c4ccd8e --- /dev/null +++ b/commands/anime.js @@ -0,0 +1,32 @@ +import {TagFilter} from "../util/tagfilter"; +import {Tag} from "../util/tag"; + +const Discord = require('discord.js'); +const UserData = require('../models/user'); +const AniData = require('../models/anime'); + +module.exports = { + name: "anime", + aliases: ['ani', 'an'], + help: new Discord.MessageEmbed() + .setTitle("Help -> Anime") + .setDescription("View and find anime in our huge list of anime!") + .addField("Syntax", "`anime <>`"), + async execute(message, msg, args, cmd, prefix, mention, client) { + if (!args.length) {return message.channel.send(`Syntax: \`${prefix}anime <>\``);} + let queue = false; + if (['a', 'add', 'n', 'new'].includes(args[0])) { + let tu = await UserData.findOne({uid: message.author.id}); + if (!tu || tu.staff) { + await message.channel.send("Since you aren't a Natsuki Staff member, this anime will be __submitted__ for reviewal!"); + queue = true; + } + let options = new TagFilter([ + new Tag(['ask', 'question'], 'ask', 'toggle'), + new Tag(['title', 't', 'name', 'n'], 'name', 'append'), + new Tag(['description', 'desc', 'd', 'plot', 'p'], 'plot', 'append') + //new Tag(['']) + ]); + } + } +}; \ No newline at end of file diff --git a/models/anime.js b/models/anime.js index 6af1ed6..bab2440 100644 --- a/models/anime.js +++ b/models/anime.js @@ -3,6 +3,7 @@ const mongoose = require('mongoose'); const AniSchema = new mongoose.Schema({ id: {type: String, unique: true}, name: String, + japname: String, plot: String, publishers: [String], studio: [String], @@ -14,7 +15,11 @@ const AniSchema = new mongoose.Schema({ genres: [String], tags: [String], characters: [String], - streamAt: [String] + streamAt: [String], + watchers: Number, + listed: Number, + liked: Number, + rating: Number }); module.exports = mongoose.model('anime', AniSchema); \ No newline at end of file