GithubHelp home page GithubHelp logo

Comments (6)

FireMasterK avatar FireMasterK commented on June 10, 2024

I see a similar behavior when testing this on my own lemmy instance:

Code:
const bot = new LemmyBot({
    instance: "feddit.rocks",
    credentials: {
        username: "PipedLinkBot",
        password: "REDACTED",
    },
    connection: {
        secondsBetweenPolls: 30,
    },
    federation: "all",
    dbFile: "db.sqlite3",
    handlers: {
        comment: ({
            commentView: {
                comment: { content, id },
            },
            botActions: { createComment },
        }) => {
            console.log(`Comment ${id} has content: ${content}`);
        },
        post: {
            handle: ({
                postView: {
                    post: { id, url, body },
                },
                botActions: { createComment },
            }) => {
                console.log(`Post ${id} has url: ${url}`);
                console.log(`Post ${id} has body: ${body}`);
            },
        },
        privateMessage: ({
            messageView: {
                private_message: { content, creator_id },
            },
            botActions: { sendPrivateMessage },
        }) => {
            console.log(`Message from ${creator_id} has content: ${content}`);
            sendPrivateMessage({
                recipient_id: creator_id,
                content: "Hello!",
            });
        },
    },
});

bot.start();

There are definitely federated comments/posts being made on my instance:
https://feddit.rocks/?dataType=Comment&listingType=All&page=1&sort=New
https://feddit.rocks/?dataType=Post&listingType=All&page=1&sort=New

from lemmy-bot.

FireMasterK avatar FireMasterK commented on June 10, 2024

I fixed this by changing the sort to New.

        comment: {
            handle: ({
                commentView: {
                    comment: { content, id },
                },
                botActions: { createComment },
            }) => {
                console.log(`Comment ${id} has content: ${content}`);
            },
            sort: "New",
        },
        post: {
            handle: ({
                postView: {
                    post: { id, url, body },
                },
                botActions: { createComment },
            }) => {
                console.log(`Post ${id} has url: ${url}`);
                console.log(`Post ${id} has body: ${body}`);
            },
            sort: "New",
        },

from lemmy-bot.

SleeplessOne1917 avatar SleeplessOne1917 commented on June 10, 2024

I fixed this by changing the sort to New.

What was it set to before? The default?

from lemmy-bot.

Pdzly avatar Pdzly commented on June 10, 2024

I fixed this by changing the sort to New.

What was it set to before? The default?

Yeah default of the account!

from lemmy-bot.

Pdzly avatar Pdzly commented on June 10, 2024

I fixed this by changing the sort to New.

        comment: {
            handle: ({
                commentView: {
                    comment: { content, id },
                },
                botActions: { createComment },
            }) => {
                console.log(`Comment ${id} has content: ${content}`);
            },
            sort: "New",
        },
        post: {
            handle: ({
                postView: {
                    post: { id, url, body },
                },
                botActions: { createComment },
            }) => {
                console.log(`Post ${id} has url: ${url}`);
                console.log(`Post ${id} has body: ${body}`);
            },
            sort: "New",
        },

It is still not even getting my test comments after waiting for 15 mins. But new comments are getting send.

from lemmy-bot.

Pdzly avatar Pdzly commented on June 10, 2024

Ok with the sort options it is somewhat acceptable and i think currently only reliable way.

from lemmy-bot.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.