AntoineFr / flarum-ext-money

Give money to your users for different actions.
MIT License
22 stars 11 forks source link

Can you disable balance from going into negative? #23

Closed ivan006 closed 1 year ago

AntoineFr commented 2 years ago

Hello @ivan006 , if you set the different "Money given" settings to positive numbers, the money won't go to negative in normal circumstances. Only an admin can manually edit the money and set it to a negative number. Do you see a particular use case for your request?

ivan006 commented 2 years ago

yes but i want to debit users for asking question but not allow them to exceed the balance (go below 0)

AntoineFr commented 2 years ago

I could add an option to prevent the balance from going below 0 but the money is given / withdrawn after a post has been published, so in your use-case, your users would still be able to post and it just wouldn't affect their money.

ivan006 commented 2 years ago

Well cant you block questions if they are in debt may i ask?

AntoineFr commented 2 years ago

I try to keep this extension simple, and your use case is very specific. You could write an extension that blocks new posts if the money is <= 0, but it would have to be checked before the post is saved. My extension works after the post is saved so it's too late, the post is already here.

ivan006 commented 2 years ago

Ok well then maybe in that case u can just disable their account if they are overdrawn which u can do before OR after a post is made.

AntoineFr commented 2 years ago

It's a very specific feature and I don't think everyone wants the same thing as you when someone has a negative balance.

I am currently working on an integration with another extension, AutoModerator (https://discuss.flarum.org/d/27306-flarum-automoderator) which can add a lot of flexibility to this extension and where you could do something like what you want.

ivan006 commented 2 years ago

cool will this release do what i want? https://github.com/askvortsov1/flarum-auto-moderator ?

ivan006 commented 2 years ago

bump

AntoineFr commented 2 years ago

I have to add some code to my extension to make it work with flarum-auto-moderator and I don't have any ETA for now. The code is almost ready, I have to test it to make sure it works correctly.

AntoineFr commented 2 years ago

Hello @ivan006 , I just tagged a new release which adds the integration with flarum-auto-moderator : https://discuss.flarum.org/d/4699-money-extension/217

This should resolve your issue !