Fix: コマンド処理済みのユーズのid除外が正しく動作しない問題 / Fix: miqコマンドのコンソール出力に値が存在しない問題
This commit is contained in:
@@ -22,19 +22,17 @@ try {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
for (const [index, notification] of response.data.entries()) {
|
const notifications = response.data.filter(notification => notification.category === "reply" && typeof notification.valueid === "string");
|
||||||
if (notification.category !== "reply")
|
|
||||||
|
const mem = Memory.memory;
|
||||||
|
const lastReadReply = mem.lastReadReply;
|
||||||
|
|
||||||
|
for (const [index, notification] of notifications.entries()) {
|
||||||
|
if (notification.category !== "reply" || typeof notification.valueid !== "string")
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (!notification.valueid) {
|
if (lastReadReply === notification.valueid)
|
||||||
console.warn("返信通知にvalueidが存在しないため、スキップします");
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
const mem = Memory.memory;
|
|
||||||
if (mem.lastReadReply === notification.valueid) {
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
|
|
||||||
const ueuseResponse = await client.request("ueuse/get", {
|
const ueuseResponse = await client.request("ueuse/get", {
|
||||||
uniqid: notification.valueid,
|
uniqid: notification.valueid,
|
||||||
@@ -48,6 +46,7 @@ try {
|
|||||||
if (index === 0) {
|
if (index === 0) {
|
||||||
const mem = Memory.memory;
|
const mem = Memory.memory;
|
||||||
mem.lastReadReply = ueuseResponse.data[0].uniqid;
|
mem.lastReadReply = ueuseResponse.data[0].uniqid;
|
||||||
|
Memory.memory = mem;
|
||||||
}
|
}
|
||||||
|
|
||||||
ueuses.push(ueuseResponse.data[0]);
|
ueuses.push(ueuseResponse.data[0]);
|
||||||
@@ -64,15 +63,16 @@ try {
|
|||||||
});
|
});
|
||||||
|
|
||||||
if (response.success) {
|
if (response.success) {
|
||||||
for (const [index, mention] of response.data.entries()) {
|
const mentions = response.data;
|
||||||
const mem = Memory.memory;
|
|
||||||
if (mem.lastReadMention === mention.uniqid) {
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (index === 0) {
|
const mem = Memory.memory;
|
||||||
const mem = Memory.memory;
|
const lastReadMention = mem.lastReadMention;
|
||||||
mem.lastReadMention = mention.uniqid;
|
mem.lastReadMention = mentions[0]?.uniqid ?? lastReadMention;
|
||||||
|
Memory.memory = mem;
|
||||||
|
|
||||||
|
for (const mention of mentions) {
|
||||||
|
if (lastReadMention === mention.uniqid) {
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ueuses.push(mention);
|
ueuses.push(mention);
|
||||||
|
|||||||
@@ -325,9 +325,10 @@ export default async function miqCommand(ueuse: ueuseModule, args: string[]) {
|
|||||||
|
|
||||||
if (!response.success) {
|
if (!response.success) {
|
||||||
console.log("返信に失敗:", response.error_code);
|
console.log("返信に失敗:", response.error_code);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.warn("ソースのユーズと/miq allowのユーザーが一致しない:", );
|
console.warn("ソースのユーズと/miq allowのユーザーが一致しない:", response.uniqid);
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user