|
@ -311,7 +311,6 @@ client.on('message', async message => { |
|
|
}) |
|
|
}) |
|
|
} else { |
|
|
} else { |
|
|
var subject = message.content.substring(15); |
|
|
var subject = message.content.substring(15); |
|
|
console.log("Subject is:", subject); |
|
|
|
|
|
var subjectURL; |
|
|
var subjectURL; |
|
|
switch (subject) { |
|
|
switch (subject) { |
|
|
case 'astro': |
|
|
case 'astro': |
|
@ -341,7 +340,6 @@ client.on('message', async message => { |
|
|
.then(response => response.json()) |
|
|
.then(response => response.json()) |
|
|
.then(data => { |
|
|
.then(data => { |
|
|
var questionNum = Math.floor(Math.random() * data.length); |
|
|
var questionNum = Math.floor(Math.random() * data.length); |
|
|
console.log(`index ${questionNum} is ${data[questionNum]}`) |
|
|
|
|
|
let filter = m => m.author.id === message.author.id; |
|
|
let filter = m => m.author.id === message.author.id; |
|
|
message.reply(data[questionNum].tossup_question).then(() => { |
|
|
message.reply(data[questionNum].tossup_question).then(() => { |
|
|
message.channel.awaitMessages(filter, { |
|
|
message.channel.awaitMessages(filter, { |
|
|