Chg: 最大震度が投稿に必要な値に満たない場合のコンソール表示を変更 / Feat: 返信ではないユーズの自主的な文字数制限
This commit is contained in:
+13
-2
@@ -15,7 +15,6 @@ export default client;
|
||||
|
||||
export const createUeuse = async (data: ApiMap["ueuse/create"]["body"], title: string) => {
|
||||
const mem = Memory.memory;
|
||||
const maxLength = mem.max_length;
|
||||
const excessedMessage = "👉返信に続きがあります。";
|
||||
|
||||
let lines = data.text.split(EOL);
|
||||
@@ -26,7 +25,13 @@ export const createUeuse = async (data: ApiMap["ueuse/create"]["body"], title: s
|
||||
count++;
|
||||
let currentText = "";
|
||||
|
||||
const limit = maxLength - (excessedMessage.length + EOL.length * 2);
|
||||
const currentMaxLength = (data.replyid !== undefined || firstUniqid !== "")
|
||||
? mem.max_length
|
||||
: config.ueuse.maxLengthWithPublic === 0
|
||||
? mem.max_length
|
||||
: config.ueuse.maxLengthWithPublic;
|
||||
|
||||
const limit = currentMaxLength - (excessedMessage.length + EOL.length * 2);
|
||||
|
||||
while (lines.length > 0) {
|
||||
const nextLine = lines[0];
|
||||
@@ -50,6 +55,8 @@ export const createUeuse = async (data: ApiMap["ueuse/create"]["body"], title: s
|
||||
}
|
||||
}
|
||||
|
||||
currentText = currentText.trimEnd();
|
||||
|
||||
if (lines.length > 0) {
|
||||
currentText += EOL.repeat(2) + excessedMessage;
|
||||
}
|
||||
@@ -87,5 +94,9 @@ export const createUeuse = async (data: ApiMap["ueuse/create"]["body"], title: s
|
||||
firstUniqid = postedUniqid;
|
||||
|
||||
console.log(`${title}を投稿(${count}):`, postedUniqid);
|
||||
|
||||
while (lines.length > 0 && lines[0]?.trim() === "") {
|
||||
lines.shift();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user