diff options
| author | Alee <alee14498@gmail.com> | 2018-02-24 23:02:00 -0500 |
|---|---|---|
| committer | Alee <alee14498@gmail.com> | 2018-02-24 23:02:00 -0500 |
| commit | dd2600e37747b6d3fc05fecf52995b872e3042c4 (patch) | |
| tree | edc8aa70847c02e1502d2aaa4648b89dbbefbf83 | |
| parent | 044d27bb9e41e6c7dc3ff882043a992003b41481 (diff) | |
| download | AstralQuote-ATC-dd2600e37747b6d3fc05fecf52995b872e3042c4.tar.gz AstralQuote-ATC-dd2600e37747b6d3fc05fecf52995b872e3042c4.tar.bz2 AstralQuote-ATC-dd2600e37747b6d3fc05fecf52995b872e3042c4.zip | |
Added quo.length
| -rw-r--r-- | bot.js | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -2,7 +2,7 @@ const Discord = require('discord.js'); const moment = require('moment');
const client = new Discord.Client();
const config = require('./config.json');
-const aqVersion = '1.2.0';
+const aqVersion = '1.2.1';
const prefix = 'aq:';
const log = message => {
@@ -44,12 +44,13 @@ function GetQuoteOfTheDay(quoteNum = -1) { QuoteOfTheDay = new Discord.RichEmbed();
+ let quo = require('./quotes.json').quotes
+
if (quoteNum == -1) {
- quoteNum = Math.floor(Math.random() * 1000) % 42;
+ quoteNum = Math.floor(Math.random() * 1000) % quo.length;
+ quo=quo[quoteNum];
}
-
- const quo = require('./quotes.json').quotes[quoteNum];
const author = quo.author;
const authorImage = quo.authorImage;
const quote = quo.quote;
|
