From 00ca521a02cda5a10752179edf0c25e0f2cadd82 Mon Sep 17 00:00:00 2001 From: na2na <49822810+na2na-p@users.noreply.github.com> Date: Thu, 14 Apr 2022 21:26:48 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[reminder]renote=E5=AF=BE=E8=B1=A1=E3=81=8C?= =?UTF-8?q?=E6=B6=88=E3=81=95=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E5=A0=B4?= =?UTF-8?q?=E5=90=88=E3=81=AB=E3=83=AA=E3=83=9E=E3=82=A4=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=E8=A7=A3=E9=99=A4=E3=82=92=E8=A1=8C=E3=81=86=E6=A9=9F?= =?UTF-8?q?=E8=83=BD=E3=81=AE=E8=BF=BD=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/modules/reminder/index.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/modules/reminder/index.ts b/src/modules/reminder/index.ts index 434e943..6813863 100644 --- a/src/modules/reminder/index.ts +++ b/src/modules/reminder/index.ts @@ -149,7 +149,12 @@ export default class extends Module { text: acct(friend.doc.user) + ' ' + serifs.reminder.notify(friend.name) }); } catch (err) { - // TODO: renote対象が消されていたらリマインダー解除 + // renote対象が消されていたらリマインダー解除 + if (err.statusCode === 400 && err.error.error.message === 'No such renote target.') { + this.unsubscribeReply(remind.thing == null && remind.quoteId ? remind.quoteId : remind.id); + this.reminds.remove(remind); + return; + } return; } } From a6444fa9dc0024c5e021ad45ef017343448bfb4c Mon Sep 17 00:00:00 2001 From: na2na <49822810+na2na-p@users.noreply.github.com> Date: Mon, 11 Apr 2022 09:49:47 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[reminder]visibility=E3=81=8Cfollowers?= =?UTF-8?q?=E3=81=AE=E3=81=A8=E3=81=8D=E3=81=ABtodo=E3=82=92=E5=8F=97?= =?UTF-8?q?=E3=81=91=E4=BB=98=E3=81=91=E3=81=AA=E3=81=84=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=9F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/message.ts | 4 ++++ src/modules/reminder/index.ts | 7 +++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/message.ts b/src/message.ts index 05c7f86..1c81439 100644 --- a/src/message.ts +++ b/src/message.ts @@ -34,6 +34,10 @@ export default class Message { return this.messageOrNote.renoteId; } + public get visibility(): string { + return this.messageOrNote.visibility; + } + /** * メンション部分を除いたテキスト本文 */ diff --git a/src/modules/reminder/index.ts b/src/modules/reminder/index.ts index 6813863..cc02141 100644 --- a/src/modules/reminder/index.ts +++ b/src/modules/reminder/index.ts @@ -59,9 +59,12 @@ export default class extends Module { const separatorIndex = text.indexOf(' ') > -1 ? text.indexOf(' ') : text.indexOf('\n'); const thing = text.substr(separatorIndex + 1).trim(); - if (thing === '' && msg.quoteId == null) { + if (thing === '' && msg.quoteId == null || msg.visibility === 'followers') { msg.reply(serifs.reminder.invalid); - return true; + return { + reaction: '🆖', + immediate: true, + }; } const remind = this.reminds.insertOne({