Inches can't be 12

This commit is contained in:
Daniel Odendahl Jr
2018-04-26 20:47:49 +00:00
parent 9b68a09247
commit f8ca8ebeb6
3 changed files with 5 additions and 4 deletions
+3 -2
View File
@@ -28,8 +28,9 @@ module.exports = class GoogleDoodleCommand extends Command {
async run(msg, { month, year }) {
const latest = month === 'latest';
if (latest) month = new Date().getMonth() + 1;
if (!year) year = new Date().getFullYear();
const now = new Date();
if (latest) month = now.getMonth() + 1;
if (!year) year = now.getFullYear();
try {
const { body } = await snekfetch.get(`https://www.google.com/doodles/json/${year}/${month}`);
if (!body.length) return msg.say('Could not find any results.');