mirror of
https://gitea.phreedom.club/localhost_frssoft/mastodon-group-bot
synced 2024-11-25 16:11:29 +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 a new issue