mirror of
https://github.com/syuilo/ai.git
synced 2025-03-25 21:12:56 +00:00
[reminder]visibilityがfollowersのときにtodoを受け付けないようにした
This commit is contained in:
parent
00ca521a02
commit
a6444fa9dc
2 changed files with 9 additions and 2 deletions
|
@ -34,6 +34,10 @@ export default class Message {
|
||||||
return this.messageOrNote.renoteId;
|
return this.messageOrNote.renoteId;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public get visibility(): string {
|
||||||
|
return this.messageOrNote.visibility;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* メンション部分を除いたテキスト本文
|
* メンション部分を除いたテキスト本文
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -59,9 +59,12 @@ export default class extends Module {
|
||||||
const separatorIndex = text.indexOf(' ') > -1 ? text.indexOf(' ') : text.indexOf('\n');
|
const separatorIndex = text.indexOf(' ') > -1 ? text.indexOf(' ') : text.indexOf('\n');
|
||||||
const thing = text.substr(separatorIndex + 1).trim();
|
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);
|
msg.reply(serifs.reminder.invalid);
|
||||||
return true;
|
return {
|
||||||
|
reaction: '🆖',
|
||||||
|
immediate: true,
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
const remind = this.reminds.insertOne({
|
const remind = this.reminds.insertOne({
|
||||||
|
|
Loading…
Reference in a new issue