Add date to google doodle

This commit is contained in:
Daniel Odendahl Jr
2017-10-28 20:16:26 +00:00
parent 415d8b9bc8
commit dc0d51994c
2 changed files with 3 additions and 2 deletions
+2 -1
View File
@@ -38,7 +38,8 @@ module.exports = class GoogleDoodleCommand extends Command {
const { body } = await snekfetch.get(`https://www.google.com/doodles/json/${year}/${month}`);
if (!body.length) return msg.say('Could not find any results.');
const data = body[latest ? 0 : Math.floor(Math.random() * body.length)];
return msg.say(data.share_text, { files: [`https:${data.url}`] });
const runDate = new Date(data.run_date_array.join('-')).toDateString();
return msg.say(`${runDate}: ${data.share_text}`, { files: [`https:${data.url}`] });
} catch (err) {
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
}
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "51.0.1",
"version": "51.0.2",
"description": "Your personal server companion.",
"main": "XiaoBot.js",
"scripts": {