Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding plusplus #16

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Adding plusplus #16

wants to merge 6 commits into from

Conversation

wpower12
Copy link

@wpower12 wpower12 commented Oct 8, 2015

Adds plusplus commands to owlbot. The commands are responses, so they must follow an 'owlbot' or 'Owlbot'. The increment and decrement commands are rate limited. Right now the limit is 5 seconds.

Commands Added:

  • [word]++ - Increments points for [word]
  • [word]-- - Decrements points for [word]
  • points [word] - Returns current point total for [word]

@@ -1,13 +1,13 @@
// Description
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just delete this whole file.

@wpower12
Copy link
Author

Looks like its working on my local hubot with a redis server running. I'm sure theres a way to keep the words more persistant, but I'll have to go learn them.

/**
* -- - Decrement points of target
* */
robot.respond('/(.*)\\\-\\\-/', function (msg) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These should be robot.hear instead of robot.respond. The reason is that respond requires @owlbot at the head of the message. We want to be able to bill++ without @owlbot bill++

The concolusion of each ++/-- should also end with owlbot returning the current score for a specific item.

@samuelcouch
Copy link
Collaborator

This is good. I did find a possible edge case? Not sure.

couch [4:04 PM]: @owlbot couch++
couch [4:04 PM]: @owlbot points couch
owlbotBOT [4:04 PM] points for couch: 0

I would probably look at the existing codebase https://github.com/ajacksified/hubot-plusplus/blob/master/src/plusplus.coffee and only modify it with the timeout stuff that you have added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants