Compare commits

...

6 Commits

Author SHA1 Message Date
Scott Kiesel 06bf6fd733
Merge pull request #253 from velour/ImpossibleGame
Yea I'll merge this. Please and thank you.
2020-03-26 15:59:44 -04:00
Scott Kiesel 4a45b21ffb Merge branch 'master' into ImpossibleGame 2020-03-26 15:51:00 -04:00
Scott Kiesel 788e6bdb4a add ability to give up 2020-03-26 15:48:06 -04:00
Chris Sexton 7148848f77 twitter: stop trying to filter RTs
* Also remove a %w causing warnings
2020-03-26 14:02:53 -04:00
Scott Kiesel 6c27e0cafd go fmt because apparently we're all too amazing to handle ill-formatted code, wimps 2020-03-13 10:23:00 -04:00
Scott Kiesel 859fb258d2 A great stupid plugin where you guess the random wikipedia article 2020-03-13 10:16:32 -04:00
3 changed files with 7 additions and 2 deletions

View File

@ -77,7 +77,7 @@ func LeaderAll(db *sqlx.DB) ([]Item, error) {
var items []Item var items []Item
err := db.Select(&items, s) err := db.Select(&items, s)
if err != nil { if err != nil {
log.Error().Msgf("Error querying leaderboard: %w", err) log.Error().Msgf("Error querying leaderboard: %s", err)
return nil, err return nil, err
} }
for i := range items { for i := range items {

View File

@ -90,6 +90,11 @@ func (p *Impossible) message(c bot.Connector, kind bot.Kind, message msg.Message
p.b.Send(c, bot.Message, message.Channel, fmt.Sprintf("You guessed the last impossible wikipedia article: \"%s\"", p.title)) p.b.Send(c, bot.Message, message.Channel, fmt.Sprintf("You guessed the last impossible wikipedia article: \"%s\"", p.title))
for !p.refreshImpossible() { for !p.refreshImpossible() {
} }
} else if strings.Contains(lowercase, "i friggin give up") {
messaged = true
p.b.Send(c, bot.Message, message.Channel, fmt.Sprintf("You're a failure the last impossible wikipedia article: \"%s\"", p.title))
for !p.refreshImpossible() {
}
} }
return messaged return messaged

View File

@ -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 && tweet.RetweetedStatus != nil { if lastTweet < tweet.Id {
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 {