mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Add date to google doodle
This commit is contained in:
@@ -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
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiaobot",
|
||||
"version": "51.0.1",
|
||||
"version": "51.0.2",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "XiaoBot.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user