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
+6
View File
@@ -1,3 +1,9 @@
# 2026.5.7
- Feat: 朝四時に何してるんだい?
- Chg: pnpm 11.1.3
- Chg: 地震情報で不明な情報をそもそも投稿しないように
- Del: helpコマンドとmiqコマンドを除く全てのi18nを廃止
# 2026.5.6
- Fix: 2026.5.5で修正されたと報告した「20件前のユーズを最後に応答したコマンドのユーズとして記録していた問題」を再発させていた問題
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "notice-uwuzu",
"version": "2026.5.6",
"version": "2026.5.7",
"type": "module",
"main": "dist/index.js",
"scripts": {
+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]));