誤字を修正・デバッグ表示の--線の位置を変更・v4.1.2

This commit is contained in:
Last2014 2025-07-04 21:55:13 +09:00
parent a96c3f0e4f
commit 678f4aa1b1
4 changed files with 18 additions and 15 deletions

View File

@ -2,25 +2,28 @@ import type { configTypes } from "types/config";
// READMEの設定項目を参照 // READMEの設定項目を参照
const config: configTypes = { const config: configTypes = {
// 時報設定
time: { time: {
// 時報休止期間
stopTimes: { stopTimes: {
start: new Date("23:00"), start: new Date("23:00"), // 開始
stop: new Date("6:00"), stop: new Date("6:00"), // 停止
} }
}, },
// 地震速報設定
earthquake: { earthquake: {
reconnectTimes: 5000, reconnectTimes: 5000, // 再接続時間(ミリ秒)
websocketUrl: "wss://api.p2pquake.net/v2/ws", websocketUrl: "wss://api.p2pquake.net/v2/ws", // WebSocketのURL
areasCsvUrl: "https://raw.githubusercontent.com/p2pquake/epsp-specifications/master/epsp-area.csv", areasCsvUrl: "https://raw.githubusercontent.com/p2pquake/epsp-specifications/master/epsp-area.csv", // 対象地域CSVファイルのURL
maxScaleMax: 30, maxScaleMin: 30, // 地震発生の際の最低震度(10-70)
rateLimit: 30, rateLimit: 30, // 地域情報更新のレート制限(分)
}, },
weather: { weather: {
splitCount: 4, splitCount: 4, // 返信の分割数
}, },
apiToken: "TOKEN_EXAMPLE", apiToken: "TOKEN_EXAMPLE", // BOTアカウントのAPIトークン
uwuzuServer: "uwuzu.example.com", uwuzuServer: "uwuzu.example.com", // uwuzuのサーバー
}; };
export default config; export default config;

View File

@ -1,6 +1,6 @@
{ {
"name": "noticeuwuzu", "name": "noticeuwuzu",
"version": "v4.1.1@uwuzu1.5.4", "version": "v4.1.2@uwuzu1.5.4",
"description": "uwuzu Notice Bot", "description": "uwuzu Notice Bot",
"main": "dist/main.js", "main": "dist/main.js",
"scripts": { "scripts": {

View File

@ -63,6 +63,8 @@ class P2PEarthquakeClient {
} }
private handleMessage(message: any): void { private handleMessage(message: any): void {
console.log("----------------");
switch (message.code) { switch (message.code) {
case 551: // 地震情報 case 551: // 地震情報
console.log("地震情報を受信しました"); console.log("地震情報を受信しました");
@ -77,7 +79,6 @@ class P2PEarthquakeClient {
this.executeEventFunc(message); this.executeEventFunc(message);
break; break;
default: default:
console.log("----------------");
console.log(`未対応の情報を受信しました(コード: ${message.code})`); console.log(`未対応の情報を受信しました(コード: ${message.code})`);
break; break;
} }
@ -145,7 +146,6 @@ async function areaMap(): Promise<Record<number, string>> {
// 情報受信 // 情報受信
async function event(earthquakeInfo: any): Promise<void> { async function event(earthquakeInfo: any): Promise<void> {
console.log("----------------");
console.log(`受信データ:${JSON.stringify(earthquakeInfo)}`); console.log(`受信データ:${JSON.stringify(earthquakeInfo)}`);
// ----処理---- // ----処理----
@ -245,7 +245,7 @@ async function event(earthquakeInfo: any): Promise<void> {
// 最大震度 // 最大震度
let maxScale: string = "最大深度:"; let maxScale: string = "最大深度:";
if (earthquakeInfo.earthquake.maxScale < config.earthquake.maxScaleMax) { if (earthquakeInfo.earthquake.maxScale < config.earthquake.maxScaleMin) {
console.log("最低震度に満たしていないため投稿されませんでした"); console.log("最低震度に満たしていないため投稿されませんでした");
return; return;
} }

2
types/config.d.ts vendored
View File

@ -2,7 +2,7 @@ interface earthquakeTypes {
reconnectTimes: number; reconnectTimes: number;
websocketUrl: string; websocketUrl: string;
areasCsvUrl: string; areasCsvUrl: string;
maxScaleMax: number; maxScaleMin: number;
rateLimit: number; rateLimit: number;
} }