Skip to content
This repository has been archived by the owner on Sep 19, 2024. It is now read-only.

feat: selectivly enable incentives #781

Closed
wants to merge 12 commits into from

Conversation

BeanieMen
Copy link
Contributor

Resolves #780

Quality Assurance:

@netlify
Copy link

netlify bot commented Sep 18, 2023

Deploy Preview for ubiquibot-staging failed.

Name Link
🔨 Latest commit 887c3a2
🔍 Latest deploy log https://app.netlify.com/sites/ubiquibot-staging/deploys/65125c43aefc3f0009d1d245

@BeanieMen
Copy link
Contributor Author

This uses a helper to boil down the comments to a list of users and if to enable or not, after when generating incentives it only generates for the users in the list if there are any

@BeanieMen
Copy link
Contributor Author

also if it is enabled

@BeanieMen
Copy link
Contributor Author

hmm

@BeanieMen
Copy link
Contributor Author

i dont get wheres the error its so lucrative

@wannacfuture
Copy link
Contributor

please make it as draft if its not ready for review, @me505

src/helpers/issue.ts Outdated Show resolved Hide resolved
src/helpers/issue.ts Outdated Show resolved Hide resolved
src/handlers/payout/post.ts Outdated Show resolved Hide resolved
src/helpers/issue.ts Outdated Show resolved Hide resolved
@BeanieMen
Copy link
Contributor Author

idk how ubiquibot-config-default.ts got changed

Copy link
Member

@0x4007 0x4007 left a comment

Choose a reason for hiding this comment

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

You're using a different prettier setting because of these extra commas, can you fix this?

for (const incentiveComment of incentiveComments) {
const parts = incentiveComment.body.split(" ");
parts.shift();
if (parts.pop() == "true") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

this relies on command order. just use a for loop and check for true, false, or starts with @ (there shouldn't more than one true or false). you can look at this example

}
const parts = body.split(" ");
parts.shift();
if (parts.pop() !== "true" && parts.pop() !== "false") {
Copy link
Collaborator

Choose a reason for hiding this comment

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

you can create a helper function that parses the command so you can use it here and in getIncentivizedUsers to avoid repeating code

@BeanieMen
Copy link
Contributor Author

gonna have to remake 💀

@BeanieMen BeanieMen closed this Sep 26, 2023
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.

Selectively enabling comment incentives per task
4 participants