2026.4.0-alpha.2 #11

Merged
last2014 merged 6 commits from develop into main 2026-05-01 13:12:21 +00:00
4 changed files with 32 additions and 22 deletions
Showing only changes of commit 3b66c47aa3 - Show all commits
+1 -1
View File
@@ -47,7 +47,7 @@ export default async function helpCommand(ueuse: ueuseModule, args: string[]) {
for (let i = 0; i < helps.length; i++) { for (let i = 0; i < helps.length; i++) {
const help = helps[i]; const help = helps[i];
if (!help) if (!help)
break; continue;
summarys += `${i18next.t(`help${help.charAt(0).toUpperCase()}${help.slice(1)}`)}${EOL}`; summarys += `${i18next.t(`help${help.charAt(0).toUpperCase()}${help.slice(1)}`)}${EOL}`;
} }
+28 -19
View File
@@ -17,16 +17,22 @@ try {
{ {
const response = await client.request("me/notification/", { const response = await client.request("me/notification/", {
page: 1,
limit: 20, limit: 20,
}); });
if (response.success) { if (response.success) {
for (const notification of response.data) { for (const [index, notification] of response.data.entries()) {
if (notification.category !== "reply") if (notification.category !== "reply")
break; continue;
if (!notification.valueid) { if (!notification.valueid) {
console.warn("返信通知にvalueidが存在しないため、スキップします"); console.warn("返信通知にvalueidが存在しないため、スキップします");
continue;
}
const mem = Memory.memory;
if (mem.lastReadReply === notification.valueid) {
break; break;
} }
@@ -36,7 +42,12 @@ try {
if (!ueuseResponse.success || !ueuseResponse.data[0]) { if (!ueuseResponse.success || !ueuseResponse.data[0]) {
console.warn("返信通知からユーズを参照できないため、スキップします"); console.warn("返信通知からユーズを参照できないため、スキップします");
break; continue;
}
if (index === 0) {
const mem = Memory.memory;
mem.lastReadReply = ueuseResponse.data[0].uniqid;
} }
ueuses.push(ueuseResponse.data[0]); ueuses.push(ueuseResponse.data[0]);
@@ -48,11 +59,24 @@ try {
{ {
const response = await client.request("ueuse/mentions", { const response = await client.request("ueuse/mentions", {
page: 1,
limit: 20, limit: 20,
}); });
if (response.success) { if (response.success) {
ueuses.push(...response.data); for (const [index, mention] of response.data.entries()) {
const mem = Memory.memory;
if (mem.lastReadMention === mention.uniqid) {
break;
}
if (index === 0) {
const mem = Memory.memory;
mem.lastReadMention = mention.uniqid;
}
ueuses.push(mention);
}
} else { } else {
console.warn("メンションの取得に失敗しましたが、続行します"); console.warn("メンションの取得に失敗しましたが、続行します");
} }
@@ -61,13 +85,6 @@ try {
ueuses = [...new Set(ueuses)]; ueuses = [...new Set(ueuses)];
for (const ueuse of ueuses) { for (const ueuse of ueuses) {
const repliedUeuse = (Memory.memory["repliedUeuse"] as string[]);
if (repliedUeuse.includes(ueuse.uniqid)) {
console.log("既に応答しているため、スキップします");
break;
}
const mem = Memory.memory; const mem = Memory.memory;
let text = ueuse.text; let text = ueuse.text;
text = text.replace(`@${mem.userid}`, ""); text = text.replace(`@${mem.userid}`, "");
@@ -119,14 +136,6 @@ try {
console.warn("ユーズの作成に失敗しました:", response.error_code); console.warn("ユーズの作成に失敗しました:", response.error_code);
break; break;
} }
{
const repliedUeuse = (Memory.memory["repliedUeuse"] as string[]);
repliedUeuse.push(ueuse.uniqid);
const mem = Memory.memory;
mem["repliedUeuse"] = repliedUeuse;
Memory.memory = mem;
}
} }
process.exit(0); process.exit(0);
+1 -1
View File
@@ -111,7 +111,7 @@ const processMessage = async (message: any) => {
for (const point of message.points) { for (const point of message.points) {
const scaleMsg = scaleMessages[String(point.scale)]; const scaleMsg = scaleMessages[String(point.scale)];
if (!scaleMsg) if (!scaleMsg)
break; continue;
points[scaleMsg]?.push(point); points[scaleMsg]?.push(point);
} }
+2 -1
View File
@@ -10,8 +10,9 @@ class MemoryClass {
if (!existsSync(path)) { if (!existsSync(path)) {
writeFileSync(path, JSON.stringify({ writeFileSync(path, JSON.stringify({
processedInfo: [], processedInfo: [],
repliedUeuse: [],
permissions: {}, permissions: {},
lastReadMention: "",
lastReadReply: "",
userid: "", userid: "",
})); }));
} }