How to make your Piston bot skip 'declined payout'-posts

Words
124
Reading
1 min
Listen
Play
9y

cryptofunk@cryptofunk asked this under my last post and I think some of you might want to use this.

To spot a post with declined payout you can check the max_accepted_payout parameter for the post. With c being the post, this would look like this:

Check:

if str(Amount(c['max_accepted_payout']))  == '0.000 SBD':

For this to work, you need to import the Amount function from the piston-lib library like this:

from piston.amount import Amount

There are probably cleaner ways to check this, but if you (like myself) learned some basic Python just for Piston, this should be an easy method.


Fun fact:

By default the max_accepted_payout is 1000000.000 SBD

Yes, that's 1 million SBD.



Good luck with your bot !

felixxx@felixxx