diff --git a/examples/config.ts b/examples/config.ts index da60546..00bad01 100644 --- a/examples/config.ts +++ b/examples/config.ts @@ -2,25 +2,28 @@ import type { configTypes } from "types/config"; // READMEの設定項目を参照 const config: configTypes = { + // 時報設定 time: { + // 時報休止期間 stopTimes: { - start: new Date("23:00"), - stop: new Date("6:00"), + start: new Date("23:00"), // 開始 + stop: new Date("6:00"), // 停止 } }, + // 地震速報設定 earthquake: { - reconnectTimes: 5000, - websocketUrl: "wss://api.p2pquake.net/v2/ws", - areasCsvUrl: "https://raw.githubusercontent.com/p2pquake/epsp-specifications/master/epsp-area.csv", - maxScaleMax: 30, - rateLimit: 30, + reconnectTimes: 5000, // 再接続時間(ミリ秒) + websocketUrl: "wss://api.p2pquake.net/v2/ws", // WebSocketのURL + areasCsvUrl: "https://raw.githubusercontent.com/p2pquake/epsp-specifications/master/epsp-area.csv", // 対象地域CSVファイルのURL + maxScaleMin: 30, // 地震発生の際の最低震度(10-70) + rateLimit: 30, // 地域情報更新のレート制限(分) }, weather: { - splitCount: 4, + splitCount: 4, // 返信の分割数 }, - apiToken: "TOKEN_EXAMPLE", - uwuzuServer: "uwuzu.example.com", + apiToken: "TOKEN_EXAMPLE", // BOTアカウントのAPIトークン + uwuzuServer: "uwuzu.example.com", // uwuzuのサーバー }; export default config; diff --git a/package.json b/package.json index 32bcf2d..bfada20 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "noticeuwuzu", - "version": "v4.1.1@uwuzu1.5.4", + "version": "v4.1.2@uwuzu1.5.4", "description": "uwuzu Notice Bot", "main": "dist/main.js", "scripts": { diff --git a/scripts/earthquakeNotice.ts b/scripts/earthquakeNotice.ts index 8d28672..d0156ee 100644 --- a/scripts/earthquakeNotice.ts +++ b/scripts/earthquakeNotice.ts @@ -63,6 +63,8 @@ class P2PEarthquakeClient { } private handleMessage(message: any): void { + console.log("----------------"); + switch (message.code) { case 551: // 地震情報 console.log("地震情報を受信しました"); @@ -77,7 +79,6 @@ class P2PEarthquakeClient { this.executeEventFunc(message); break; default: - console.log("----------------"); console.log(`未対応の情報を受信しました(コード: ${message.code})`); break; } @@ -145,7 +146,6 @@ async function areaMap(): Promise> { // 情報受信 async function event(earthquakeInfo: any): Promise { - console.log("----------------"); console.log(`受信データ:${JSON.stringify(earthquakeInfo)}`); // ----処理---- @@ -245,7 +245,7 @@ async function event(earthquakeInfo: any): Promise { // 最大震度 let maxScale: string = "最大深度:"; - if (earthquakeInfo.earthquake.maxScale < config.earthquake.maxScaleMax) { + if (earthquakeInfo.earthquake.maxScale < config.earthquake.maxScaleMin) { console.log("最低震度に満たしていないため投稿されませんでした"); return; } diff --git a/types/config.d.ts b/types/config.d.ts index 0ce6af4..be64784 100644 --- a/types/config.d.ts +++ b/types/config.d.ts @@ -2,7 +2,7 @@ interface earthquakeTypes { reconnectTimes: number; websocketUrl: string; areasCsvUrl: string; - maxScaleMax: number; + maxScaleMin: number; rateLimit: number; }