···55 "github.com/bluesky-social/indigo/automod"
66)
7788+var _ automod.PostRuleFunc = BadHashtagsPostRule
99+810// looks for specific hashtags from known lists
911func BadHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
1012 for _, tag := range ExtractHashtags(post) {
···1618 }
1719 return nil
1820}
2121+2222+var _ automod.PostRuleFunc = TooManyHashtagsPostRule
19232024// if a post is "almost all" hashtags, it might be a form of search spam
2125func TooManyHashtagsPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
+2
automod/rules/identity.go
···99 "github.com/bluesky-social/indigo/automod/countstore"
1010)
11111212+var _ automod.IdentityRuleFunc = NewAccountRule
1313+1214// triggers on first identity event for an account (DID)
1315func NewAccountRule(c *automod.AccountContext) error {
1416 // need access to IndexedAt for this rule
+4
automod/rules/interaction.go
···991010var interactionDailyThreshold = 800
11111212+var _ automod.RecordRuleFunc = InteractionChurnRule
1313+1214// looks for accounts which do frequent interaction churn, such as follow-unfollow.
1315func InteractionChurnRule(c *automod.RecordContext) error {
1416 did := c.Account.Identity.DID.String()
···3638 }
3739 return nil
3840}
4141+4242+var _ automod.RecordRuleFunc = DeleteInteractionRule
39434044func DeleteInteractionRule(c *automod.RecordContext) error {
4145 did := c.Account.Identity.DID.String()
+6
automod/rules/keyword.go
···77 "github.com/bluesky-social/indigo/automod"
88)
991010+var _ automod.PostRuleFunc = KeywordPostRule
1111+1012func KeywordPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
1113 for _, tok := range ExtractTextTokensPost(post) {
1214 if c.InSet("bad-words", tok) {
···1820 return nil
1921}
20222323+var _ automod.ProfileRuleFunc = KeywordProfileRule
2424+2125func KeywordProfileRule(c *automod.RecordContext, profile *appbsky.ActorProfile) error {
2226 for _, tok := range ExtractTextTokensProfile(profile) {
2327 if c.InSet("bad-words", tok) {
···2832 }
2933 return nil
3034}
3535+3636+var _ automod.PostRuleFunc = ReplySingleKeywordPostRule
31373238func ReplySingleKeywordPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
3339 if post.Reply != nil && !IsSelfThread(c, post) {
+4
automod/rules/misleading.go
···7878 return false
7979}
80808181+var _ automod.PostRuleFunc = MisleadingURLPostRule
8282+8183func MisleadingURLPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
8284 // TODO: make this an InSet() config?
8385 if c.Account.Identity.Handle == "nowbreezing.ntw.app" {
···99101 }
100102 return nil
101103}
104104+105105+var _ automod.PostRuleFunc = MisleadingMentionPostRule
102106103107func MisleadingMentionPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
104108 // TODO: do we really need to route context around? probably
+2
automod/rules/private.go
···77 "github.com/bluesky-social/indigo/automod"
88)
991010+var _ automod.PostRuleFunc = AccountPrivateDemoPostRule
1111+1012// dummy rule. this leaks PII (account email) in logs and should never be used in real life
1113func AccountPrivateDemoPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
1214 if c.Account.Private != nil {
+2
automod/rules/profile.go
···55 "github.com/bluesky-social/indigo/automod"
66)
7788+var _ automod.PostRuleFunc = AccountDemoPostRule
99+810// this is a dummy rule to demonstrate accessing account metadata (eg, profile) from within post handler
911func AccountDemoPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
1012 if c.Account.Profile.Description != nil && len(post.Text) > 5 && *c.Account.Profile.Description == post.Text {
+2
automod/rules/promo.go
···1010 "github.com/bluesky-social/indigo/automod/countstore"
1111)
12121313+var _ automod.PostRuleFunc = AggressivePromotionRule
1414+1315// looks for new accounts, with a commercial or donation link in profile, which directly reply to several accounts
1416//
1517// this rule depends on ReplyCountPostRule() to set counts
+4
automod/rules/replies.go
···1010 "github.com/bluesky-social/indigo/automod/countstore"
1111)
12121313+var _ automod.PostRuleFunc = ReplyCountPostRule
1414+1315// does not count "self-replies" (direct to self, or in own post thread)
1416func ReplyCountPostRule(c *automod.RecordContext, post *appbsky.FeedPost) error {
1517 if post.Reply == nil || IsSelfThread(c, post) {
···34363537// triggers on the N+1 post, so 6th identical reply
3638var identicalReplyLimit = 5
3939+4040+var _ automod.PostRuleFunc = IdenticalReplyPostRule
37413842// Looks for accounts posting the exact same text multiple times. Does not currently count the number of distinct accounts replied to, just counts replies at all.
3943//