HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

New plugin: Bot (formerly shwaipbot)

LincLinc Detroit Admin
edited January 2016 in Feedback

[see the 2015 update below]

Give the System user a mind of its own: http://vanillaforums.org/addon/shwaipbot-plugin https://vanillaforums.org/addon/bot-plugin

Repo is here: https://github.com/lincolnwebs/VanillaExtracts https://github.com/linc/vanilla-bot

It's a developer-only kinda plugin because you need to code your own botreplies file. It's super simple tho, so any level of developer should be able to do it if you know PHP basics.

If you come up with any clever replies (functions) you want to share, please do. :)

Comments

  • peregrineperegrine MVP
    edited December 2013

    I'm going to teach mine to say

    "Shwailcome To My Forum" to all newcomers.

    The next phrase will be

    Please Enter your "Shwersion of Wanilla"

    and the tird replay will be

    Please ShwaPost under Schwa correct ShwaPlugin.

    if only it was the SchwaIPBot

    htt://en.wikipedia.org/wiki/Schwa

    or shaboobieBot

    http://www.urbandictionary.com/define.php?term=Shaboobie

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    I noticed this plugin has no icon ? so here is one I made for you @Lincoln

  • LincLinc Detroit Admin

    Why... is a gorilla crying?

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    @Lincoln said:
    Why... is a gorilla crying?

    lol, he is not a gorilla !! he's a Schwasquatch and he is not crying, that how they show they are happy to serve .... ;)

  • vrijvlindervrijvlinder Papillon-Sauvage MVP
  • @System said: I vote for the middle one!

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • LincLinc Detroit Admin

    Middle one it is! It'll be in the next release. Thanks!

  • LincLinc Detroit Admin

    @vrijvlinder If you don't mind, @Vorgo has absconded with your Sasquatch.

  • vrijvlindervrijvlinder Papillon-Sauvage MVP

    Awesome, at least someone will use it, I think he is rather cute !!

  • LincLinc Detroit Admin
    edited August 2015

    2015 update: I've done a new plugin based on what I started with shwaipbot. The big differences are:

    • Eliminated extra config file in favor of having other plugins hook into it as if it were a normal event in Vanilla.
    • Silos the "reply" mechanism so there's room to grow in other directions - it's less linear now.
    • Added hook to new discussions instead of just comments.
    • Made it significantly easier to work with and documented it fully.

    Introducing Bot.

    You'll see shwaipbot lives on as an implementation example in the docs, and the name remains in use as my private implementation of Bot. :) Pre-release feedback welcome.

  • LincLinc Detroit Admin

    With Vorgo working, I've gone ahead and released it.

  • LincLinc Detroit Admin
    edited August 2015

    Version 1.1 cleans up some things and adds an 'afterSay' event to hook into.

    I've used it to make my bot appear online when he replies (via Who's Online).

        /**
         * Show as online.
         *
         * @param Bot $bot
         */
        public function bot_afterSay_handler($bot) {
            if (!class_exists('WhosOnlinePlugin')) {
                return;
            }
    
            $now = Gdn_Format::toDateTime();
            $px = Gdn::sql()->Database->DatabasePrefix;
            $botID = $bot->botID();
            $sql = "insert {$px}Whosonline (UserID, Timestamp, Invisible) values ({$botID}, :Timestamp, :Invisible)
                on duplicate key update Timestamp = :Timestamp1, Invisible = :Invisible1";
            Gdn::database()->query($sql, array(':Timestamp' => $now, ':Invisible' => 0, ':Timestamp1' => $now, ':Invisible1' => 0));
        }
    
Sign In or Register to comment.