mirror of
https://github.com/kou029w/daraz-san.git
synced 2025-01-18 16:08:06 +00:00
Kohei Watanabe
5152efc6ff
主要な変更点 - CoffeeScript をやめる - cron.coffee は機能していないため削除 - ruby.coffee は機能していないため削除 - www.coffee は #general でしか使われていないため削除 - *便器*はリンク切れしていたため削除 - *鳥取*は栃木県ではないため削除 Co-authored-by: SAKAGUCHI Takashi <takashi.sakaguchi@ummm.info> Co-authored-by: Masayuki Higashino <mh61503891@users.noreply.github.com> Co-authored-by: Kazuki Shigemichi <shigemichik@gmail.com>
30 lines
801 B
JavaScript
30 lines
801 B
JavaScript
const subMinutes = require("date-fns/subMinutes");
|
||
const roundToNearestMinutes = require("date-fns/roundToNearestMinutes");
|
||
const format = require("date-fns/format");
|
||
const nyanco = require("./util/nyanco");
|
||
|
||
const prefNumber = 34;
|
||
const pageURL = `https://www.tenki.jp/radar/7/${prefNumber}/`;
|
||
const imgURL = target =>
|
||
[
|
||
"https://static.tenki.jp/static-images/radar/",
|
||
format(target, "yyyy/MM/dd/HH/mm/ss"),
|
||
`/pref-${prefNumber}-large.jpg`
|
||
].join("");
|
||
|
||
module.exports = [
|
||
/天気/,
|
||
async ({ say }) => {
|
||
const target = roundToNearestMinutes(subMinutes(new Date(), 5), {
|
||
nearestTo: 5
|
||
});
|
||
|
||
say(
|
||
[
|
||
`${nyanco()} < ${format(target, "HH時mm分の雨雲の様子にゃーん")}`,
|
||
imgURL(target),
|
||
pageURL
|
||
].join("\n")
|
||
);
|
||
}
|
||
];
|