誤字を修正・デバッグ表示の--線の位置を変更・v4.1.2
This commit is contained in:
parent
a96c3f0e4f
commit
678f4aa1b1
|
@ -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;
|
||||
|
|
|
@ -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": {
|
||||
|
|
|
@ -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<Record<number, string>> {
|
|||
|
||||
// 情報受信
|
||||
async function event(earthquakeInfo: any): Promise<void> {
|
||||
console.log("----------------");
|
||||
console.log(`受信データ:${JSON.stringify(earthquakeInfo)}`);
|
||||
|
||||
// ----処理----
|
||||
|
@ -245,7 +245,7 @@ async function event(earthquakeInfo: any): Promise<void> {
|
|||
// 最大震度
|
||||
let maxScale: string = "最大深度:";
|
||||
|
||||
if (earthquakeInfo.earthquake.maxScale < config.earthquake.maxScaleMax) {
|
||||
if (earthquakeInfo.earthquake.maxScale < config.earthquake.maxScaleMin) {
|
||||
console.log("最低震度に満たしていないため投稿されませんでした");
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -2,7 +2,7 @@ interface earthquakeTypes {
|
|||
reconnectTimes: number;
|
||||
websocketUrl: string;
|
||||
areasCsvUrl: string;
|
||||
maxScaleMax: number;
|
||||
maxScaleMin: number;
|
||||
rateLimit: number;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue