Skip to content

Commit

Permalink
날짜 제한 하루 늘림
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-maki committed Feb 18, 2024
1 parent 006a47f commit 7614dec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,11 @@ const streaming = createStreamingAPIClient({
});

function checkIsSpam(status: mastodon.v1.Status) {
//console.log(status.inReplyToId, status.account.acct, status.account.username, status.account.displayName, status.mentions.length, dayjs(status.account.createdAt).isSame(dayjs(), 'day'), /^[a-z0-9]{10}$/.test(status.account.username));
return status.inReplyToId === null &&
status.account.acct.includes('@') &&
(status.account.username === status.account.displayName || status.account.displayName.length === 0) &&
status.mentions.length >= 1 &&
dayjs(status.account.createdAt).isSame(dayjs(), 'day') &&
dayjs(status.account.createdAt).isAfter(dayjs().subtract(2, 'day'), 'day') &&
/^[a-z0-9]{10}$/.test(status.account.username);
}

Expand Down

0 comments on commit 7614dec

Please sign in to comment.