[sockbot] I wanted a robot, So I made one

  • Plugin & Theme Dev

    @exodo said in [sockbot] I wanted a robot, So I made one:

    SyntaxError: Use of const in strict mode.

    hmm...

    let me guess..... node version 0.12?

    sockbot unfortunately uses a lot of features of ES6 and thus requires version 4.0 to run.

    it may be possible to run in version 0.12 using the --harmony command line flag but that configuration is, unfortunately not supported. 😞

  • Plugin & Theme Dev

    @accalia said in [sockbot] I wanted a robot, So I made one:

    @exodo said in [sockbot] I wanted a robot, So I made one:

    SyntaxError: Use of const in strict mode.

    hmm...

    let me guess..... node version 0.12?

    sockbot unfortunately uses a lot of features of ES6 and thus requires version 4.0 to run.

    it may be possible to run in version 0.12 using the --harmony command line flag but that configuration is, unfortunately not supported. 😞

    i see, my test server doesnt support that new realeases, thank anyways

  • Plugin & Theme Dev

    @exodo said in [sockbot] I wanted a robot, So I made one:

    i see, my test server doesnt support that new realeases, thank anyways

    unless there's a specific reason why the newer versions of nodejs are not supported i have found nvm to work just fine for managing multiple versions of nodsjs.

    in fact all development for sockbot is done using nvm installed version of node so as to allow me to quickly switch between versions to test functionality against multiple versions of nodejs.

    I'd be happy to help you set up a user account on your test server with nvm so that you can use sockbot on that server without interfering with the already installed applications..... if that's a thing you'd like to do?

    I have also confirmed that cloud9 ide fully supports sockbot in its free tier (and comes with nvm preconfigured). Workspaces for the free tier are quickly frozen when idle, so good for testing, not so good for long term use.

  • Plugin & Theme Dev

    @accalia said in [sockbot] I wanted a robot, So I made one:

    @exodo said in [sockbot] I wanted a robot, So I made one:

    i see, my test server doesnt support that new realeases, thank anyways

    unless there's a specific reason why the newer versions of nodejs are not supported i have found nvm to work just fine for managing multiple versions of nodsjs.

    in fact all development for sockbot is done using nvm installed version of node so as to allow me to quickly switch between versions to test functionality against multiple versions of nodejs.

    I'd be happy to help you set up a user account on your test server with nvm so that you can use sockbot on that server without interfering with the already installed applications..... if that's a thing you'd like to do?

    I have also confirmed that cloud9 ide fully supports sockbot in its free tier (and comes with nvm preconfigured). Workspaces for the free tier are quickly frozen when idle, so good for testing, not so good for long term use.

    thanks for the support, i wil check all that
    i work on synology so actually i think its not posible to update it

  • Plugin & Theme Dev

    @exodo said in [sockbot] I wanted a robot, So I made one:

    i work on synology so actually i think its not posible to update it

    hmm... interesting. don't think i've worked with them before. I've got a QNAP NAS myself and use an Intel NUC, or a Raspberry Pi, as my test box....

    still NVM should work for you, it installs to your home directory so it doesn't interfere with other users or the system.

    @exodo said in [sockbot] I wanted a robot, So I made one:

    thanks for the support

    no worries. it's what i do. let me know if i can do anything more to help.


  • When i install bot ant try to run it i get error
    "nodebb A-derp! Fatal Startup Error: Unexpected token < " HELP?

  • Plugin & Theme Dev

    @Domas-Vileikis interesting error...

    could you post the configuration file you are using for the bot (with password redacted for security) so i can take a look at it? most errors like this are simple typos in configuration and should be easy to solve.

  • GNU/Linux Admin

    Eh, usually unexpected token < is encountered when you're trying to parse JSON and you received HTML instead...

  • Plugin & Theme Dev

    @julian true, but as this is a startup error it's highly likely to be caused by a misconfiguration in the config file (usually the wrong URL for the forum)

  • Anime Lovers

    I want to know if people use it for malicious perpose? For instance, some could run a script that frequently post ADs to our forum, thus cause our forum unable to run normally? Is it possible to use it without administrative permission?😦

  • Community Rep

    @jiangcaiyang They can do that without a bot, so any restrictions on the bot would be superfluous.

  • Anime Lovers

    @yariplus So what is typical use of a bot?

  • Community Rep

    Automation. It does what a human could do only faster/easier. For instance, the bot could post my messages to twitter, facebook, g+, etc. for me. It frequently also runs scripts such as this one, for playing games or funny messages, role-playing, etc..

  • Anime Lovers

    @yariplus Maybe I will use it when I realize that it is truly useful for me. At present, I'll just see it without use it.


  • @accalia ---

    • core:
      username: "Sekretore"
      password: "error"
      owner: "Domas"
      forum: "http://mywebiste.eu"
      plugins:
      summoner:
      messages:
      - "@%username%, You seem malnourished. Are you suffering from internal parasites?"
      - "@%username%. I challenge you to "clawplach"!"
      - "I wonder what the Shroud of Turin tastes like."
      - "Yeah, but did you ever play Jenga? Sometimes you take out one and... [imitates crashing]"
      - "It's good cholesterol, but it spreads like bad cholesterol."
      - "Zoidberg is afoot!"
      - "On margin. Zoidbee wants to buy on margin."
      - "Zoidbie want balloon! Want balloon now! Zoidbie want go outside!"
      - "Tired of Discourse? Why not @Zoidberg?"
      - "I took the liberty of fertilizing your caviar."
      - "I've had it with this game. I'm going for a scuttle."
      - "Doctor Zoidberg, soaking in brine."
      - "You lost the @%username% of your dreams, but you still have Zoidberg. YOU ALL STILL HAVE ZOIDBERG!"
      - "Sit down @%username%. Now open your mouth and lets have a look at that brain. "
      - "Young lady, I am an expert on humans. Now pick a mouth, open it and say "brglgrglgrrr"! "
      - "Hooray! People are paying attention to me!"
      - "I've performed a few mercy killings."
      - "It's been years since medical school, so remind me. Disemboweling in your species, fatal or non-fatal?"
      - "The frenzy is over. How am I going to get rid of my male jelly now?"
      - "Welcome to my life! :starts crying:"
      - "I don't like the looks of this doctor. I bet I've lost more patients than he's treated."
      - "What? My mother was a saint! Get out!"
      - "It's funny because it's poisonous!"
      - "Fine, then I'll have one of your young on a roll."
      - "Fine, just give me something crawling with parasites."
      - "And I'm his friend, Jesus!"
      - "Hooray! I'm a teenage heartthrob again!"
      - "There's a humongous fungus among us."
      - "I ate garbage yesterday, and it didn't cost me 300 dollars."
      - "Hey, boys and girls. It's Zoidberg, the loveable tramp."
      - "Hooray! A happy ending for the rich people."
      - "Switch bodies? I don't see why not. I also don't see why."
      - "The hell with your spoiled baby. I need those shoes."
      - "@%username%, look what you did! She won't shut up."
      - "Friends! Help! A guinea pig tricked me!!"
      - "Is it me maybe?"
      - "Once again, the conservative, sandwich-heavy portfolio pays off for the hungry investor."
      - "Ohhh, it's all so complicated, with the flowers, and the romance, and the lies upon lies."
      - "What's this? Two meals in one week?"
      - "Friends! Help! A @%username% tricked me!"
      - "Oh, no! Something's happening! What's happening?"
      - "Are you coming on to me?"
      - "At last, recognition!"
      - "Hello? I'll take eight!"
      - "Hooray! I'm helping!"
  • Plugin & Theme Dev

    @Domas-Vileikis hmm... well other than nodebb being very confused with the formatting that looks okay.

    can you run the bot as follows and post the results to me via chat? This command will be very verbose with debugging information and may contain sensitive information so please do not post the results publically.

    DEBUG=* sockbot config.yml
    

    that command should provide me with additional information to figure out what's happening so we can sort you out. 😉

  • Plugin & Theme Dev

    @jiangcaiyang said in [sockbot] I wanted a robot, So I made one:

    I want to know if people use it for malicious perpose?

    yes, that's possible.

    @jiangcaiyang said in [sockbot] I wanted a robot, So I made one:

    For instance, some could run a script that frequently post ADs to our forum, thus cause our forum unable to run normally?

    yes, but sockbot is incapable of that, it needs a manually registered account so would be far too quickly banned. there are other bots that run the spam.

    @jiangcaiyang said in [sockbot] I wanted a robot, So I made one:

    Is it possible to use it without administrative permission?

    yes, but i hereby formally declare that anyone doing so with sockbot is a total poopy pants. 😉

    sockbot is meant for fun, not malice.


  • @accalia said in [sockbot] I wanted a robot, So I made one:

    DEBUG=* sockbot config.yml

  • Plugin & Theme Dev

    @Domas-Vileikis okay..... that's strange as heck.....

    that's not where i expected that failure to occur.

    however i do know what the cause is. and i can help you fix it.

    the error occurs trying to load the configuration settings for the forum in order to get the CSRF token to log in. this is done by loading /api/config on your forum.

    so, for example, if you were running a bot for this forum the value you would have put in core.forum would be https://community.nodebb.org and so the configuration would be at https://community.nodebb.org/api/config

    can you check to make sure that when you visit the URL in your configuration for core.forum you arrive at your forum's home page and that when loading /api/config relative to that URL in the manner i described above your browser loads a JSON document.

    if one or both of these manual checks fail then the value you put in the configuration for core.forum is incorrect and needs to be updated. if both checks pass when tried in a browser then it is most likely your forum has some sort of security in place that is preventing sockbot's user agent access to the REST API of the forum. you will need to update the firewall rules in this case to allow sockbot access, or if you are not the administrator of the webserver your forum runs on you will need to ask your server admin to update the firewall rules for you.

    hoping this gets you off and running with sockbot,
    -Accalia


  • hi

    I have an error when I run sockbot config.yml

    sockbot config.yml
    [2017-10-08T19:56:35.508Z] Starting Sockbot 6.3.6
    [2017-10-08T19:56:35.517Z] Loaded configuration file: config.yml
    [2017-10-08T19:56:35.517Z] Activating logon: LdM
    [2017-10-08T19:56:35.704Z] Using provider nodebb for LdM
    [2017-10-08T19:56:35.707Z] Loading plugin echo for LdM
    [2017-10-08T19:56:35.708Z] LdM ready for login
    [2017-10-08T19:56:36.391Z] A-derp! Fatal Startup Error: [[error:invalid-login-credentials]]

    $ DEBUG=* sockbot config.yml
    [2017-10-08T20:01:29.716Z] Starting Sockbot 6.3.6
    [2017-10-08T20:01:29.725Z] Loaded configuration file: config.yml
    [2017-10-08T20:01:29.725Z] Activating logon: LdM
    sockbot requiring providers nodebb as /usr/lib/node_modules/sockbot/lib/../providers/nodebb +0ms
    [2017-10-08T20:01:29.918Z] Using provider nodebb for LdM
    [2017-10-08T20:01:29.922Z] Loading plugin echo for LdM
    sockbot requiring plugins echo as /usr/lib/node_modules/sockbot/lib/../plugins/echo +196ms
    [2017-10-08T20:01:29.923Z] LdM ready for login
    sockbot:provider:nodebb begin configuration fetch for CSRF token +0ms
    sockbot:provider:nodebb completed configuration fetch for CSRF token +467ms
    sockbot:provider:nodebb begin post login data +0ms
    sockbot:provider:nodebb Login failed for reason: [[error:invalid-login-credentials]] +267ms
    sockbot Error: [[error:invalid-login-credentials]]
    sockbot at errorify (/usr/lib/node_modules/sockbot/providers/nodebb/index.js:211:23)
    sockbot at Request.request.post [as _callback] (/usr/lib/node_modules/sockbot/providers/nodebb/index.js:239:39)
    sockbot at Request.self.callback (/usr/lib/node_modules/sockbot/node_modules/request/request.js:186:22)
    sockbot at emitTwo (events.js:125:13)
    sockbot at Request.emit (events.js:213:7)
    sockbot at Request.<anonymous> (/usr/lib/node_modules/sockbot/node_modules/request/request.js:1163:10)
    sockbot at emitOne (events.js:115:13)
    sockbot at Request.emit (events.js:210:7)
    sockbot at IncomingMessage.<anonymous> (/usr/lib/node_modules/sockbot/node_modules/request/request.js:1085:12)
    sockbot at Object.onceWrapper (events.js:314:30) +737ms
    [2017-10-08T20:01:30.659Z] A-derp! Fatal Startup Error: [[error:invalid-login-credentials]]

    my password and login are ok

    Namely my database is not on the server

Suggested Topics

| |