robertoszek / pleroma-bot

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

Only thread replies? #112

Open dawnerd opened 1 year ago

dawnerd commented 1 year ago

It seems threads are not pulled in unless replies: true which isn't very useful for the accounts I have set up. Since they're mostly PR related it's a ton of responses to customers and gets very noisy. Are threads supposed to be included by default? Could there be a way to only grab them?

robertoszek commented 1 year ago

Hi! Right, technically threads are just replies from users to themselves. So in the current version they get filtered out when setting include_replies to false.

We could include a check before filtering the replies to see if the the user is replying to themselves and keep it when a certain mapping is set to true.

I'm trying to think what would be the easiest way to define this on the configuration, would something like this make sense?:

include_replies: false
include_threads: true
dawnerd commented 1 year ago

include_threads would definitely do the trick.

robertoszek commented 1 year ago

Alright, on 1.2.1rc6 this should do it: pip install -i https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple pleroma-bot==1.2.1rc6

As mentioned above, by setting the mapping include_threads to true should keep the Twitter threads even if the replies are filtered.

So this config, for example:

twitter_token: XXX
- twitter_username: XXX
  pleroma_username: XXX
  pleroma_token: XXX
  bot: true
  include_replies: false
  include_threads: true  <--

(or this one if if you want it to apply it globally to all the users):

twitter_token: XXX
include_replies: false
include_threads: true  <--
- twitter_username: XXX
  pleroma_username: XXX
  pleroma_token: XXX
  bot: true

I'll need to write some coverage tests and documentation before rolling it out to the stable release.

dawnerd commented 1 year ago

Just gave this a shot and it seems to work beautifully! Nice!