aboutsummaryrefslogtreecommitdiff
path: root/commands/addquote.js
blob: 633447013df13de2865098aea643d752ba3e2a83 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
/** **************************************
 *
 *   AddQuote: Command for AleeBot
 *   Copyright (C) 2017-2021 Alee Productions
 *
 *   This program is free software: you can redistribute it and/or modify
 *   it under the terms of the GNU General Public License as published by
 *   the Free Software Foundation, either version 3 of the License, or
 *   (at your option) any later version.
 *
 *   This program is distributed in the hope that it will be useful,
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *   GNU General Public License for more details.
 *
 *   You should have received a copy of the GNU General Public License
 *   along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * *************************************/
const mongo = require('../plugins/mongo');
const quoteSchema = require('../schema/quote-schema');
module.exports.run = async (client, message, args) => {
/*
	let authorMessage;
	let authorImageMessage;
	let quoteMessage;
	let yearMessage;*/

	if (!['242775871059001344'].includes(message.author.id)) return message.reply('**This command is disabled due to a new system being implemented.**');
	//await message.author.send('Welcome to AleeBot\'s quoting system!\nThis process will be easy.');

	if (!args.length) return message.reply("Error: Did not provide more context (message will be replaced eventually)");

	await mongo().then(async (mongoose) => {
		try {
			await new quoteSchema({
				author: args[0],
				authorImage: args[1],
				quote: args[2],
				year: args[3]

			}).save()
		} finally {
			await mongoose.connection.close();
			message.reply('Added this quote to the database...');
		}
	})

/*
	let quoteState = {};
	let state = quoteState[message.author.id];

	if (message.content.toLowerCase() === "q"){
		await message.author.send("Process has been cancelled");
		state = null;
	} else {
		switch (state) {
			case 1:
				await message.author.send('Enter the author\'s name');
				authorMessage = message.content;
				console.log(authorMessage);
				state = 2;
			break;
			case 2:
				await message.author.send('author url here');
				authorImageMessage = message.content;
				console.log(authorImageMessage);
				state = 3;
			break;
			case 3:
				await message.author.send('quote here');
				quoteMessage = message.content;
				console.log(quoteMessage);
				state = 4;
			break;
			case 4:
				await message.author.send('year here');
				yearMessage = message.content;
				console.log(yearMessage);
				state = 5;
			break;
			case 5:
				await message.author.send('process complete');
				state = null;
			break;
		}
*/
};

exports.conf = {
	aliases: [],
	guildOnly: true,
};
exports.help = {
	name: 'addquote',
	description: 'Sets the guild prefix.',
	usage: 'addquote [author] [authorImage] [quote] [year]',
	category: '- Quote Commands',
};