mirror of https://github.com/velour/catbase.git
twitter: filter out retweets
This commit is contained in:
parent
fc18fba2d8
commit
4275619e49
|
@ -72,7 +72,7 @@ func (t *Twitter) check(c bot.Connector) {
|
||||||
for _, tweet := range tweets {
|
for _, tweet := range tweets {
|
||||||
userKey := fmt.Sprintf("twitter.last.%s", u)
|
userKey := fmt.Sprintf("twitter.last.%s", u)
|
||||||
lastTweet := int64(t.c.GetInt(userKey, 0))
|
lastTweet := int64(t.c.GetInt(userKey, 0))
|
||||||
if lastTweet < tweet.Id {
|
if lastTweet < tweet.Id && tweet.RetweetedStatus != nil {
|
||||||
link := fmt.Sprintf("https://twitter.com/%s/status/%s", u, tweet.IdStr)
|
link := fmt.Sprintf("https://twitter.com/%s/status/%s", u, tweet.IdStr)
|
||||||
log.Debug().Str("tweet", link).Msg("Unknown tweet")
|
log.Debug().Str("tweet", link).Msg("Unknown tweet")
|
||||||
for _, ch := range chs {
|
for _, ch := range chs {
|
||||||
|
|
Loading…
Reference in New Issue