aboutsummaryrefslogtreecommitdiff
path: root/commands/quote.js
diff options
context:
space:
mode:
authorAndrew Lee <alee14498@protonmail.com>2021-07-29 16:00:22 -0400
committerAndrew Lee <alee14498@protonmail.com>2021-07-29 16:00:22 -0400
commit06dd6383d7a239817c2a9724465896ef7da70bc2 (patch)
tree8c5f63e6adc1a5cd47737d88e44fd7c76f325ea2 /commands/quote.js
parentffc85798c04897d1ddaed61a9be40e5bb0a8792f (diff)
downloadAleeBot-06dd6383d7a239817c2a9724465896ef7da70bc2.tar.gz
AleeBot-06dd6383d7a239817c2a9724465896ef7da70bc2.tar.bz2
AleeBot-06dd6383d7a239817c2a9724465896ef7da70bc2.zip
Big changes
Diffstat (limited to 'commands/quote.js')
-rw-r--r--commands/quote.js44
1 files changed, 38 insertions, 6 deletions
diff --git a/commands/quote.js b/commands/quote.js
index 149fe37..69e810a 100644
--- a/commands/quote.js
+++ b/commands/quote.js
@@ -1,7 +1,7 @@
/** **************************************
*
* Quote: Command for AleeBot
- * Copyright (C) 2017-2020 Alee Productions
+ * 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
@@ -17,17 +17,49 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* *************************************/
-module.exports.run = async (client, message) => {
+const mongo = require('../plugins/mongo');
+const quoteSchema = require('../schema/quote-schema');
+module.exports.run = async (client, message, args) => {
+ if (!['242775871059001344'].includes(message.author.id)) return message.reply('**This command is disabled due to a new system being implemented.**');
const Discord = require('discord.js');
let NewQuote;
+ let quo;
+
+ let quoId;
+ let quoAuthor;
+ let quoAuthorImage;
+ let quoQuote;
+ let quoYear;
+
+ if (args) {
+ await mongo().then(async (mongoose) => {
+ try {
+ const quote = await quoteSchema.findOne({quoteID: "1", author: quoAuthor, authorImage: quoAuthorImage, quote: quoQuote, year: quoYear})
+ /*const embed = new Discord.MessageEmbed()
+ .setAuthor(quoAuthor, quoAuthorImage)
+ .setDescription(quoQuote)
+ .setColor('#1fd619')
+ .setFooter('- ' + quoYear);
+
+ await message.channel.send({embed});*/
+ console.log(quote);
+ } finally {
+ await mongoose.connection.close();
+ }
+ })
+ } else {
+
+ }
+
+ /*
function GetNewQuote(quoteNum = -1) {
NewQuote = new Discord.MessageEmbed();
- let quo = require('../storage/quotes.json').quotes;
+ let quo = require('../storage/quotes.json').quotes
- if (quoteNum == -1) {
+ if (quoteNum === -1) {
quoteNum = Math.floor(Math.random() * 1000) % quo.length;
quo=quo[quoteNum];
}
@@ -42,14 +74,14 @@ module.exports.run = async (client, message) => {
NewQuote.setColor('#1fd619');
NewQuote.setDescription(quote);
NewQuote.setFooter('- ' + year);
- NewQuote.setURL(url);
+ //NewQuote.setURL(url);
return NewQuote;
}
const newquote = GetNewQuote();
message.reply('Alright, here\'s your quote.');
- message.channel.send(newquote);
+ await message.channel.send(newquote);*/
};
exports.conf = {