Skip to content
This repository has been archived by the owner on Oct 20, 2018. It is now read-only.

Thanks command improvement #83

Closed
wants to merge 8 commits into from

Conversation

abhisekp
Copy link
Member

@abhisekp abhisekp commented Apr 16, 2016

Improved thanks command implementation

- **Using `lodash` for better performance due to lazy evaluation** - **Discards non-existing users and self while thanking and thank only existing ones** (which also fixes thanking `@/all` as a bonus) i.e. if a user doesn't exist in gitter, then there will be no API calls to thank that user.

Command

thanks @camperbot @/all @all @belindarogers

Bot Response

@abhisekp sends brownie points to @camperbot and @belindarogers ✨ 👍 ✨
⚠️ could not find receiver for belindarogers
⭐ 1560 | @camperbot | http://www.freecodecamp.com/camperbot

  • Improved bot response about giving brownie points

OLD

abhisekp sends brownie points to @rphares and @qmikew1 and @dwd2010 and @camperbot and @csegate2 ✨ 👍 ✨

NEW

@abhisekp sends brownie points to @GitterBotX, @camperbot, @ltegman, @SaintPeter and @noncentz ✨ 👍 ✨



Tested in GitterBotX/playground


NOTE: Added dedent module which removes unwanted indentations from template strings. Please use npm install to install the new package 📦 .

Fixes #76
Fixes dcsan/gitterbot#170

@abhisekp abhisekp force-pushed the fix/thanks-improvement branch from 1a1b99e to 4ac453c Compare April 16, 2016 04:58
@abhisekp abhisekp mentioned this pull request Apr 16, 2016
@abhisekp abhisekp force-pushed the fix/thanks-improvement branch from 4ac453c to 4a17513 Compare April 16, 2016 10:19
&& !!user.userId
)
.map((user) => user.screenName)
.value();
Copy link
Member Author

@abhisekp abhisekp Apr 16, 2016

Choose a reason for hiding this comment

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

Please move the thankList iteration to the end of the method and no need to unwrap it before. This ensures best lazy evaluation performance.

@SaintPeter
Copy link
Member

Any progress?

As per ☝️ This Comment in HelpContributors

There is a new user with the name E-Tank - and just entering a reply or comment on one of their questions automatically gives them brownie points.

@abhisekp
Copy link
Member Author

abhisekp commented Apr 24, 2016

@SaintPeter that is addressed by @noncentz in https://github.com/FreeCodeCamp/camperbot/pull/78

Just need to remove the line linked here and then that can be merged.

@ltegman
Copy link
Member

ltegman commented May 1, 2016

I'm really confused what is going on in this thread. @abhisekp Is this ready? I see you've written a bunch of critiques on your own PR so I'm not really sure what the status of this is.

@abhisekp
Copy link
Member Author

abhisekp commented May 1, 2016

@ltegman it is not ready yet.. I've to implement the suggestions. Bit busy these days... Will correct them ASAP and ping you. 👍

abhisekp added 4 commits May 17, 2016 10:11
- Use lodash
- Discard non-existing users and self and thank only existing ones (which also fixes thanking @/all as a bonus)
 E.g. if a user doesn't exist in gitter, then there will be no API calls to thank that user.
- fixed some messages
- formatted source a bit
@abhisekp abhisekp force-pushed the fix/thanks-improvement branch from 4a17513 to 04b9b6e Compare May 18, 2016 07:43
@abhisekp
Copy link
Member Author

🙅 DO NOT MERGE 🙅

@raisedadead
Copy link
Member

@abhisekp I know you are busy, but this would be great to have this soon. ;)

@ltegman
Copy link
Member

ltegman commented Oct 16, 2016

Closing as stale. Please reopen when this is ready to be merged.

@ltegman ltegman closed this Oct 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Camperbot to ignore @/all thanks Multiple thanks to a user with multiple mentions
4 participants