p0o / steem-bot

Easy automation on top of Steem blockchain
MIT License
53 stars 40 forks source link

Resteem others' posts with this API? #6

Closed antoncoding closed 2 years ago

antoncoding commented 6 years ago

I've been developing a bot with this package for a while, but I can't figure out how to resteem a user's post. I'm currently doing it with another Python Script, is there any chance I can integrate the two into one script? Thanks for helping ;)

TwinkieWInkie commented 6 years ago

I'm doing it through steemjs myself. Wouldn't be too hard to add this to the response object.

`
            const action = JSON.stringify(['reblog', {
                account: user.username,
                author: item.author,
                permlink: item.permlink
            }])
            global.steem.broadcast.customJson(
                wif,
                [],
                [user.username],
                'follow',
                action,
                function (err, res) {
                    console.log(err)
                    console.log(res)
                }
                        )
`
p0o commented 6 years ago

As @TwinkieWInkie said, you can always use SteemJS for custom usecases not supported by this package. However, I think it's a useful function that can be embedded in SteemBot too. I will try to add the feature soon.

AdyWasHere commented 6 years ago

Anychance you could tell me exactly where to place that and how to call it, for some reason I can't make it work, I want to have a community bot that once he upvotes a post he will resteem it, I tryed to add that inside the voting code, so once he votes, he will resteem after but I could not make it work. Thanks in advance.

TwinkieWInkie commented 6 years ago

Library is called SteemJS.

AND JESUS FUCKING INFO PLEASE. Oh shit does not work doesn't fucking cut it @AdyWasHere

AdyWasHere commented 6 years ago

Why so angry out of nowhere? I was just asking where should place the code you wrote above, inside @p0o 's code to make the resteem option available. I never used JS before, I tried making a function inside randowhale.js and call it after but that did not work, I tried adding it inside the responder.js and call it after the vote in randowhale.js but that did not work either.

TwinkieWInkie commented 6 years ago

I'll give you this courtesy, once.

Show us the errors and your script, and we'll show you how wrong it is :)

TwinkieWInkie commented 6 years ago

If you want to make modifications to steem-bot: git clone .. cd ffs npm install do modifications in /src, npm run build Push to your own repo and npm install yourrepo in your project

p0o commented 6 years ago

@AdyWasHere You can use his code inside any handler functions from SteemBot. You just need to know what event you need to trigger with SteemBot and do whatever you want inside the handler functions. Just make sure to install the steem package from npm and put this on top of your code:

import steem from 'steem';

Do so and if you had error put your full code with errors here so someone can help.

TwinkieWInkie commented 6 years ago

@p0o You can assign me on this one

p0o commented 6 years ago

@TwinkieWInkie Sure. I added you as a collaborator but cannot find your name in Assignees list. I think you need to create the issue yourself, or be a previous contributor. Strange tho...

TwinkieWInkie commented 6 years ago

I'll commit in a bit

TwinkieWInkie commented 6 years ago

@p0o FYI, Untested