Skip to content

Commit

Permalink
Default joining channel (#40)
Browse files Browse the repository at this point in the history
* [add] - デフォルトで参加するチャンネルを適用

* [fix] - 型

* [add] - サーバー設定の最大メッセージ長へ対応
  • Loading branch information
NfoAlex authored May 27, 2024
1 parent 1073620 commit fbfef0c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/actionHandler/Message/saveMessage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import sqlite3 from "sqlite3";
const db = new sqlite3.Database("./records/MESSAGE.db");
import { ServerInfo } from "../../db/InitServer";

import { IMessage } from "../../type/Message";

Expand All @@ -22,6 +23,11 @@ export default async function saveMessage(
reaction: {}
};

//もしメッセージ長がサーバー設定より長ければエラー
if (message.content.length > ServerInfo.config.MESSAGE.TxtMaxLength) {
return null;
}

//メッセージID用の乱数生成
const randId = Math.floor(Math.random()*9999).toString().padStart(4, "0");

Expand Down

0 comments on commit fbfef0c

Please sign in to comment.