robertoszek / pleroma-bot

Bot for mirroring one or multiple Twitter accounts in Pleroma/Mastodon/Misskey.
https://robertoszek.github.io/pleroma-bot
MIT License
102 stars 19 forks source link

add a way to set the "bot" attribute automatically #96

Closed us3r1d closed 1 year ago

us3r1d commented 1 year ago

"bot" appears to be an attribute of the account (judging from the Mastodon docs at https://docs.joinmastodon.org/entities/Account/#bot, I don't know about Pleroma).

I do know adding it to pleroma-bot's "fields" config doesn't work. :-)

Can you add a per-account setting to the .yml file to set the bot attribute?

Thanks, -robin

robertoszek commented 1 year ago

Sure thing, it makes sense to add this option letting you set the flag on each user (or globally for all users on your config). In Mastodon there's the /update_credentials endpoint that lets you set the bot flag. Pleroma's API is the mostly the same with extra fields. I need to check how Misskey does it.

I'm thinking that when we get the profile info from the Fedi account we can check if the bot flag differs from the one defined on your .yml config, and only update it then (instead of setting it every run).

I'll look into it, thanks for the suggestion!

robertoszek commented 1 year ago

Ah, Misskey's endpoint is i/update and the field is called isBot. Adding it here as a note so I don't forget.

robertoszek commented 1 year ago

@us3r1d Alright, I've committed the changes to the develop branch: 34ab2955e7842ba0c8c9971373914f3f0e3b0423

They will be rolled into the next stable release, but feel free to try it out by installing the latest release candidate version like so: pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pleroma-bot==1.1.1rc22

You can use the bot mapping like this on your config:

pleroma_base_url: https://mastodon.instance
twitter_token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
users:
- twitter_username: User1
  pleroma_username: XXXXX # Account ID
  # Mastodon Bearer token
  pleroma_token: XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX 
  bot: true  # <--
us3r1d commented 1 year ago

That was a remarkably fast response; thank you very much. This will help a lot.

And now that I'm moving onto an rc release I'll get all the crash fixes I've seen you making for issues that have been glitching on my install too. :-)

Thanks, -robin

robertoszek commented 1 year ago

No problem!

You may also find some new crashes on the rc release as it's bound to be less extensively tested than the stable release 😅 Don't hesitate to open a new issue if you run into any problems with it.

You can also check what's new on the rc release by going to the "Unreleased" section on the changelog of the develop branch: https://github.com/robertoszek/pleroma-bot/blob/develop/CHANGELOG.md