Chg: 地震発生情報の時刻に頃を追加 / Feat: ユーズが分割の何個目のユーズかをコンソールに表示
This commit is contained in:
+8
-4
@@ -18,18 +18,20 @@ export const createUeuse = async (data: ApiMap["ueuse/create"]["body"], title: s
|
||||
const maxLength = mem.max_length;
|
||||
const excessedMessage = "👉返信に続きがあります。";
|
||||
|
||||
// 行単位で分割
|
||||
let lines = data.text.split(EOL);
|
||||
let firstUniqid = "";
|
||||
let count = 0;
|
||||
|
||||
while (lines.length > 0) {
|
||||
count++;
|
||||
let currentText = "";
|
||||
|
||||
const limit = maxLength - (excessedMessage.length + EOL.length * 2);
|
||||
|
||||
while (lines.length > 0) {
|
||||
const nextLine = lines[0];
|
||||
if (nextLine === undefined) break;
|
||||
if (nextLine === undefined)
|
||||
break;
|
||||
|
||||
if (nextLine.length > limit && currentText === "") {
|
||||
const targetLine = lines.shift() || "";
|
||||
@@ -81,7 +83,9 @@ export const createUeuse = async (data: ApiMap["ueuse/create"]["body"], title: s
|
||||
break;
|
||||
}
|
||||
|
||||
if (firstUniqid === "") firstUniqid = postedUniqid;
|
||||
console.log(`${title}を投稿:`, postedUniqid);
|
||||
if (firstUniqid === "")
|
||||
firstUniqid = postedUniqid;
|
||||
|
||||
console.log(`${title}を投稿(${count}):`, postedUniqid);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user