2019-07-28 01:52:06 +09:00
|
|
|
const { directMention } = require("@slack/bolt");
|
|
|
|
const nyanco = require("./util/nyanco");
|
|
|
|
|
|
|
|
// Description:
|
|
|
|
// だらずさんは JSON のお掃除がだいすきです
|
|
|
|
//
|
|
|
|
// Synopsis:
|
|
|
|
// json <jsonstring> - あなたの JSON をぷりちーにするにゃん
|
|
|
|
|
|
|
|
module.exports = [
|
|
|
|
directMention(),
|
|
|
|
/json +(.*)/i,
|
|
|
|
({ context, say }) => {
|
|
|
|
try {
|
|
|
|
const json = JSON.parse(context.matches[1]);
|
|
|
|
const res = JSON.stringify(json, null, 2);
|
2020-04-09 00:24:48 +09:00
|
|
|
return say([`${nyanco()} っ`, "```", res, "```"].join("\n"));
|
2019-07-28 01:52:06 +09:00
|
|
|
} catch (e) {
|
|
|
|
console.error(e);
|
|
|
|
}
|
2020-04-09 00:16:46 +09:00
|
|
|
},
|
2019-07-28 01:52:06 +09:00
|
|
|
];
|