Lullabot / lubot

1 stars 0 forks source link

Karma command can break with user names in the text #52

Closed m4olivei closed 9 years ago

m4olivei commented 9 years ago

If you enter a formal "@" as part of a karma command, the results can be strange, eg.

> something @molbot++
something <@U0611ET4P has a karma of 1
> @molbot at the coffee shop++
molbot has a karma of 6

The crux of the issue is that the text that lubot gets to work with has the user id translated from @molbot to <@U0611ET4P> and sometimes lubot breaks on that.

Also related is this case:

> daft punk++
daft punk has a karma of 3
> karma daft punk
daft has a karma of 0

This is b/c slackUserStrip takes the first token of the string as the karm lookup. Relic from when this karma script was limited to usernames.

m4olivei commented 9 years ago

Resolved in https://github.com/Lullabot/lubot/pull/53