Hi folks, so glad this channel is here.

Recently, I:

  • Created a community called fullmoviesonyoutube on lemm.ee
  • Decided I wanted to write a bot to post helpful comments when people post movies there.
  • Created another community called fullmoviesbottesting.
  • Created a user on lemm.ee called fullmoviesbot
  • Wrote and tested the bot from my PC using the lemmy-bot as a starting point, pointing it at that ‘fullmoviesbottesting’ community, until I was finally pretty happy with it.
  • Updated the bot’s code so the federation - allowlist points to ‘fullmoviesonyoutube’ on the same lemm.ee instance.
  • Ran the bot, created a post with my personal lemmy account… and nothing happened.

The bot is not creating comments in the new channel. It’s like it doesn’t see posts created by any other users.

Is there something I need to do to get my bot to recognize posts from other users in the new channel?

I did a test where I logged into lemm.ee in my browser with the bot’s user, and created a post and the bot created a comment on that post, but for some reason, that bot-created post doesn’t show up in the community. This is that “orphaned” post: https://lemm.ee/post/2896238

I guess another way to ask this - what are the rules for bot’s when it comes to creating comments on other user’s posts?

EDIT — Here’s the full code: https://controlc.com/dd54eae6

(it’s rough - don’t judge me) Thanks!

  • ClanOfTheOcho@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    1 year ago

    For the record, Strange Brew is an awesome movie.

    Are you using any sort of automated web testing framework to do the work, or did you custom roll your own? Or are you using some sort of API? Your methodology may narrow down the issue.

      • ClanOfTheOcho@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        1 year ago

        Some things to think about:

        • Does the bot need to be a moderator?
        • Does the same behavior occur if you log in through the web with the bot’s account?

        And maybe you’ve already thought of these and tried them. It’s past my bedtime, so my brain isn’t chugging along at full power. It’s as though my brain is telling me, “Take off, eh, you hoser!”

  • freamon@endlesstalk.org
    link
    fedilink
    English
    arrow-up
    2
    ·
    1 year ago

    Strange Brew is a confusing post to work with - there’s 2 of them, one by you, and one by the bot. Typically, when a post is cross-posted to its own community, only one is visible.

    It might be easier to ask why the bot replied to Mr Nice Guy and not Fight Club. Only your error logs can tell you this.
    There’s no rules about who a bot can reply to. I made a reply in the Fight Club post from a bot account using this:

    my_instance="https://feddit.nl"
    
    auth="my-jwt-string"
    post_id=1232490				# feddit.nl's version of the post
    
    API="api/v3"
    content="Sigh. Yet another Mr Robot ripoff"
    
    create() {
            end_point="comment"
            json_data="{\"auth\":\"$auth\",\"post_id\":$post_id,\"content\":\"$content\",\"language_id\":37}"
    
            url="$my_instance/$API/$end_point"
    
            curl -H "Content-Type: application/json" -d "$json_data" "$url"
    }
    
    create