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

[V3 Economy] Add per-role payouts to Economy with [p]economyset rolepaydayamount #1488

Merged
merged 2 commits into from
Apr 15, 2018
Merged

[V3 Economy] Add per-role payouts to Economy with [p]economyset rolepaydayamount #1488

merged 2 commits into from
Apr 15, 2018

Conversation

skmendez
Copy link
Contributor

@skmendez skmendez commented Apr 1, 2018

Type

  • Bugfix
  • Enhancement
  • New feature

Description of the changes

This is only possible if the bank isn't global. When payday is ran, the maximum of all of the payouts (default of 0 for every role) for the roles the Member has and the default guild payout is paid to the user.

@skmendez skmendez requested a review from palmtree5 as a code owner April 1, 2018 22:19
@skmendez skmendez changed the title Added per-role payouts to Economy with [p]economyset rolepayoutamount Add per-role payouts to Economy with [p]economyset rolepayoutamount Apr 1, 2018
@skmendez skmendez changed the title Add per-role payouts to Economy with [p]economyset rolepayoutamount [V3 Economy] Add per-role payouts to Economy with [p]economyset rolepayoutamount Apr 1, 2018
@skmendez skmendez changed the title [V3 Economy] Add per-role payouts to Economy with [p]economyset rolepayoutamount [V3 Economy] Add per-role payouts to Economy with [p]economyset rolepaydayamount Apr 1, 2018
@palmtree5 palmtree5 added the V3 label Apr 2, 2018
@tekulvw
Copy link
Member

tekulvw commented Apr 2, 2018

Why is this limited to global?

@palmtree5
Copy link
Member

@tekulvw it's not lol. Role-based payday payouts are restricted to the bank NOT being global

@@ -255,7 +260,12 @@ def __init__(self, bot: Red):
else:
next_payday = await self.config.member(author).next_payday()
if cur_time >= next_payday:
await bank.deposit_credits(author, await self.config.guild(guild).PAYDAY_CREDITS())
credit_amount = await self.config.guild(guild).PAYDAY_CREDITS()
for role in author.roles:
Copy link
Member

Choose a reason for hiding this comment

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

why iterate through all of a user's roles to find a payday amount rather than just getting the payday amount based on the user's top role?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

All roles don't necessarily have a corresponding pay-out, so while their top role might be Admin, their highest pay-out role might be Gold/Platinum or the like.

@palmtree5 palmtree5 merged commit d75881e into Cog-Creators:V3/develop Apr 15, 2018
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

3 participants