mirror of
https://git.phreedom.club/localhost_frssoft/mastodon-group-bot.git
synced 2024-12-27 03:29:48 +00:00
Not DM notifications about follow in replies
This commit is contained in:
parent
262a480ffe
commit
8f34b1de88
11
bot.go
11
bot.go
@ -146,16 +146,23 @@ func RunBot() {
|
|||||||
add_to_db(acct)
|
add_to_db(acct)
|
||||||
InfoLogger.Printf("%s added to database", acct)
|
InfoLogger.Printf("%s added to database", acct)
|
||||||
}
|
}
|
||||||
|
if notif.Status.InReplyToID == nil { // Prevent spam in DM if status is reply
|
||||||
message := fmt.Sprintf("@%s %s", acct, Conf.NotFollowedMessage)
|
message := fmt.Sprintf("@%s %s", acct, Conf.NotFollowedMessage)
|
||||||
_, err := postToot(message, "direct")
|
_, err := postToot(message, "direct")
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ErrorLogger.Printf("Notify %s", acct)
|
ErrorLogger.Printf("Notify %s", acct)
|
||||||
}
|
}
|
||||||
InfoLogger.Printf("%s has been notified", acct)
|
InfoLogger.Printf("%s has been notified", acct)
|
||||||
|
|
||||||
mark_notice(acct)
|
mark_notice(acct)
|
||||||
|
if got_notice(acct) == 0 {
|
||||||
|
InfoLogger.Printf("Dooble notice marked")
|
||||||
|
mark_notice(acct)
|
||||||
|
}
|
||||||
InfoLogger.Printf("%s marked notification in database", acct)
|
InfoLogger.Printf("%s marked notification in database", acct)
|
||||||
|
} else {
|
||||||
|
InfoLogger.Printf("%s their status is reply, not notified", acct)
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user