Begin work on anime command; added anime schema

master
Kit Kasune 4 years ago
parent 97396f243f
commit 50aa98e5d7
  1. 32
      commands/anime.js
  2. 7
      models/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([''])
]);
}
}
};

@ -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);
Loading…
Cancel
Save