Don't respond to mentions from bots.

Requires mattn/go-mastodon#79.
This commit is contained in:
Ben Lubar 2018-10-20 16:51:18 -05:00
parent db7b9d6e10
commit 725bb9b81a
No known key found for this signature in database
GPG Key ID: 92939677AB59EDA4
3 changed files with 5 additions and 4 deletions

2
go.mod
View File

@ -1,5 +1,7 @@
module github.com/lynnesbian/mstdn-ebooks
replace github.com/mattn/go-mastodon => github.com/BenLubar-PR/go-mastodon v0.0.3-0.20181020214714-b83071c1d6fe // indirect
require (
github.com/gorilla/websocket v1.4.0 // indirect
github.com/mattn/go-mastodon v0.0.3-0.20180129050910-2ccbcfe14d7a

4
go.sum
View File

@ -1,7 +1,7 @@
github.com/BenLubar-PR/go-mastodon v0.0.3-0.20181020214714-b83071c1d6fe h1:QHvU/GniPgBLnR+unZL2uQCJFJim2k+khiq5tDARJd8=
github.com/BenLubar-PR/go-mastodon v0.0.3-0.20181020214714-b83071c1d6fe/go.mod h1:FSdXZyYNF22wiS4coSWuDdmJwZIUbLeyoLoUxrTFvXQ=
github.com/gorilla/websocket v1.4.0 h1:WDFjx/TMzVgy9VdMMQi2K2Emtwi2QcUQsztZ/zLaH/Q=
github.com/gorilla/websocket v1.4.0/go.mod h1:E7qHFY5m1UJ88s3WnNqhKjPHQ0heANvMoAMk2YaljkQ=
github.com/mattn/go-mastodon v0.0.3-0.20180129050910-2ccbcfe14d7a h1:poZfGmljz6MxMXvFcYQvTx7TJQ2J9Gb+B2lgjOIPQnA=
github.com/mattn/go-mastodon v0.0.3-0.20180129050910-2ccbcfe14d7a/go.mod h1:/OSOSDJyV0OUlBuDV0Qrllizt3BJNj4Ir5xhckYRVmg=
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80 h1:nrZ3ySNYwJbSpD6ce9duiP+QkD3JuLCcWkdaehUS/3Y=
github.com/tomnomnom/linkheader v0.0.0-20180905144013-02ca5825eb80/go.mod h1:iFyPdL66DjUD96XmzVL3ZntbzcflLnznH0fr99w5VqE=
golang.org/x/net v0.0.0-20181017193950-04a2e542c03f h1:4pRM7zYwpBjCnfA1jRmhItLxYJkaEnsmuAcRtA347DA=

View File

@ -88,8 +88,7 @@ func main() {
case *mastodon.DeleteEvent:
// Ignore (for now)
case *mastodon.NotificationEvent:
if e.Notification.Type != "mention" {
log.Printf("Ignoring notification of type %q", e.Notification.Type)
if e.Notification.Type != "mention" || e.Notification.Account.Bot {
continue
}
_, err := client.PostStatus(ctx, genToot(ctx, me, e.Notification.Status))