Chg: 地震情報で不明な情報をそもそも投稿しないように / 2026.5.7

This commit is contained in:
2026-05-21 22:35:56 +09:00
parent 6fc5ab9d0d
commit 11f29463a6
3 changed files with 25 additions and 15 deletions
+18 -14
View File
@@ -168,20 +168,24 @@ const processMessage = async (message: any) => {
const earthquakeNoticeText = [];
earthquakeNoticeText.push(`### ${typeMessage[message.issue.type] ?? "地震情報"}`);
earthquakeNoticeText.push(`⏰時刻: ${format(new Date(message.earthquake.time), "yyyy年M月d日 H:mm")}`);
earthquakeNoticeText.push(`🫨最大震度: scaleMessages[String(message.earthquake.maxScale)]`);
earthquakeNoticeText.push(`📍震源地: ${message.earthquake.hypocenter.name === ""
? "不明"
: message.earthquake.hypocenter.name}`);
earthquakeNoticeText.push(`💪マグニチュード: ${message.earthquake.hypocenter.magnitude === -1
? "不明"
: `M${message.earthquake.hypocenter.magnitude.toFixed(1)}`}`);
earthquakeNoticeText.push(`🪨深さ: ${message.earthquake.hypocenter.depth === 0
? "ごく浅い"
: message.earthquake.hypocenter.depth === -1
? "不明"
: `${message.earthquake.hypocenter.depth}km`}`);
earthquakeNoticeText.push(domesticTsunamiMessages[(message.earthquake.domesticTsunami ?? "Unknown")]);
earthquakeNoticeText.push(foreignTsunamiMessages[(message.earthquake.foreignTsunami ?? "Unknown")]);
earthquakeNoticeText.push(`🫨最大震度: ${scaleMessages[String(message.earthquake.maxScale)]}`);
earthquakeNoticeText.push(...(message.earthquake.hypocenter.name === ""
? []
: [`📍震源地: ${message.earthquake.hypocenter.name}`]));
earthquakeNoticeText.push(...(message.earthquake.hypocenter.magnitude === -1
? []
: [`💪マグニチュード: M${message.earthquake.hypocenter.magnitude.toFixed(1)}`]));
earthquakeNoticeText.push(...(message.earthquake.hypocenter.depth === -1
? []
: [`🪨深さ: ${message.earthquake.hypocenter.depth === 0
? "ごく浅い"
: `${message.earthquake.hypocenter.depth}km`}`]));
earthquakeNoticeText.push(...(message.earthquake.domesticTsunami ?? "Unknown" === "Unknown"
? []
: [domesticTsunamiMessages[(message.earthquake.domesticTsunami)]]));
earthquakeNoticeText.push(...(message.earthquake.foreignTsunami ?? "Unknown" === "Unknown"
? []
: [foreignTsunamiMessages[(message.earthquake.foreignTsunami)]]));
earthquakeNoticeText.push(...(pointsMsg === ""
? []
: [EOL + pointsMsg]));