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

parse @mention thanks as well as thanks @mention #28

Open
dcsan opened this issue Aug 1, 2015 · 12 comments
Open

parse @mention thanks as well as thanks @mention #28

dcsan opened this issue Aug 1, 2015 · 12 comments
Assignees

Comments

@dcsan
Copy link
Owner

dcsan commented Aug 1, 2015

people often type like:

@terabyte thanks, will check out the readme

that should be picked up / filtered in the same way as normal thanks @xx
use a regex to match in the whole input.
we may have to add another part to the "parseInput" section to handle these

@dcsan
Copy link
Owner Author

dcsan commented Aug 2, 2015

dupe of #35

@dcsan dcsan added P2 and removed P3 labels Aug 2, 2015
@dcsan
Copy link
Owner Author

dcsan commented Aug 2, 2015

7e7f678e-3856-11e5-9b39-55ca8c861034

@dcsan
Copy link
Owner Author

dcsan commented Aug 2, 2015

write a GBot.scanInput function, similar to the parseInput
search for thanks anywhere inside a message.
get the @mention people in that message
send karma to them

@dcsan
Copy link
Owner Author

dcsan commented Aug 7, 2015

ok bit more thoughts on how to do this.

the scanInput method gets called on every message currently:
https://github.com/dcsan/gitterbot/blob/master/nap/data/rooms/RoomMessages.js#L105-L112

however, the "thanks" response is not just static text - its a function.
so we could modify the entries in the

 var SharedMessages = {

to also return functions, as well as just static text. its a bit meta but i think this would be a really versatile way to implement this and allow us to have keywords trigger functions.

@dcsan
Copy link
Owner Author

dcsan commented Aug 10, 2015

@irinatag the code for roomMessages is now using regex pls check it out!

@irinatag
Copy link
Collaborator

@dcsan sure!

irinatag added a commit that referenced this issue Aug 10, 2015
@dcsan
Copy link
Owner Author

dcsan commented Aug 10, 2015

I made some more changes to it, please pull from branch 28

image

@dcsan
Copy link
Owner Author

dcsan commented Aug 10, 2015

so this works now with for example the 'txtx' and a @username but can you add a better regex to find the format above on @username thanks and maybe some other options people may type in.

i had to merge in master which included some other changes. this area needs refactoring i think.
@oab00 FYI on this above commit.

@dcsan
Copy link
Owner Author

dcsan commented Aug 10, 2015

oops, this commit 0ec2592

quite a gnarly merge

@irinatag
Copy link
Collaborator

@dcsan ok, thanks for doing that! I'll work on it.

@irinatag
Copy link
Collaborator

@dcsan pushed my regex. one issue that's now popping up: the warning that I already gave you points gets logged, but doesn't display to the user.

nap_ irinatag_irinas-macbook-air____dev_gitterbot_nap zsh _51x57
demobot_test-_gitter

not sure if you have a ticket for that yet. otherwise, seems to be working, but I'm also a regex noob.

@dcsan
Copy link
Owner Author

dcsan commented Aug 15, 2015

if you see problems like that it should definitely be a separate issue, or its too hard to track lots of things on one ticket.

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

No branches or pull requests

2 participants