anjanms / DubAPI

A Node.js API for creating queup.net bots.
MIT License
20 stars 10 forks source link

add setrole #5

Closed Fuechschen closed 8 years ago

Fuechschen commented 8 years ago

Well, it's just making bots capable of setting roles...

anjanms commented 8 years ago

Hey, thanks for submitting another PR. Sorry it's taken me so long to review this.

A couple things with this one.

I'll probably combine set and unset into one method, unless you want to.

Thanks again. :smiley:

Fuechschen commented 8 years ago

So, i hope i changed it right...

I also added changed the way, moderateRemoveDJ works (https://github.com/dubtrack/www-dubtrack-fm/issues/164). (If you just want to remove the specific song, use moderateRemoveSong)

anjanms commented 8 years ago

You've got the right idea. But looking at the diff I see three issues.

The permission is 'set-roles' (plural), you have 'set-role'. The indexOf check won't work as roles isn't an array. It should just be an undefined check. (roles[role] === undefined)

Also it looks like you accidentally deleted the media methods, please re-add those.

moderateRemoveDJ and moderateRemoveSong look good. :+1:

Thanks

Fuechschen commented 8 years ago

So, i hope i haven't forgot anything... Yeah, sorry for that, seems like i totally switched off my brain that day...

anjanms commented 8 years ago

Perfect. :+1:

You'll see an update with this soon.