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

cool plugin lincoln

peregrineperegrine MVP
edited December 2013 in Feedback

I really like this plugin, the most interesting one I've seen in a while because it is so different. Thanks for sharing it.

I noticed a couple of things - not sure if it was intention or not. (I tested with version 1.0 of plugin and vanilla 2.1b2

  • I will try 1.1 of the plugin later (not sure if you made other changes besides removing extra ). I added strtolower on both sides of the comparison as well for the simple match

1) occasionally the system response will precede the message it is responding to.

2) when entering a discussion the matches and reply by system will not occur.

3) system only replies to comments (in other words not the discussion post itself).

I added a few items to play around with. I'm looking forward to executing other actions with this plugin besides system replies.

In image 1 - the discussion is not responded to by system. I added another comment muffin man, system then responded but the system comment preceded my comment.

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

Comments

  • Can you make the reply be a link to a song ? btw I know who is the muffin man

    http://www.youtube.com/watch?v=qwIrXOtZyvQ

  • yes just add this to botreplies.php

    function BotMuffinMan($Bot) {
    
       $MuffinReply = <<<EOT
         <p>
    <span class="VideoWrap">
    <span id="youtube-qwIrXOtZyvQ" class="Video YouTube">
    <span class="VideoPreview">
    <a href="//youtube.com/watch?v=qwIrXOtZyvQ">
    <img border="0" height="385" width="640" src="//img.youtube.com/vi/qwIrXOtZyvQ/0.jpg">
    </a>
    </span>
    <span class="VideoPlayer"></span>
    </span>
    </span>
    </p>
    EOT;
    

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

  • Theoretically just replying with the YouTube link should do all that, no?

    1) Bizarre! I've never seen that. I'll look into it. If you can track it down I'd appreciate it.

    2 & 3) This is true. I guess I don't really like the idea of the bot being the first reply or starting discussions with the intent of triggering the System bot. In any case, I purposefully only triggered it on comments. I could be persuaded to change it but I guess I don't intrinsically see the value.

    Thanks for the kind words :)

  • peregrineperegrine MVP
    edited December 2013

    here's a mod to work with the discussion - you could probably do it more elegantly.

    • I just wanted to see if I could do it. seems to work

      public function PostController_AfterCommentSave_Handler($Sender, $Args) {
      $this->ShwaiSave($Sender, $Args);
      }

      public function PostController_AfterDiscussionSave_Handler($Sender, $Args) {
      $this->ShwaiSave($Sender, $Args);
      }

      public function ShwaiSave($Sender, $Args) {
      if (!GetValue('Editing', $Args)) {
      $Comment = GetValue('Comment', $Args);
      if (!$Comment)
      $Comment = GetValue('Discussion', $Args);
      $Bot = new ShwaipBot();
      $Bot->SetDiscussion(GetValue('Discussion', $Args));
      $Bot->SetInstigator(UserBuilder($Comment, 'Insert'));
      $Bot->EvaluateReplyTo(GetValue('Body', $Comment));
      $Bot->Say();
      }
      }

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

  • I agree, this is a very interesting plugin. I am thinking about using it on one of my forums for automated answers to some tech support FAQ like "how do I reboot in safe mode?" or "how do I reset the PRAM?".

  • @Lincoln said :Theoretically just replying with the YouTube link should do all that, no?

    Yes it does actually but with peregrines code you can style it to fit the space better.
    This would be great to use as a vj or dj. You could simply load the replies with the links and whenever anyone writes play The Macarena, then the bot simply posts the link.

    Good aid for teaching too :)

  • It's pretty cool you can also program it to have system reply based on comment counts and discussion count, reactions, etc. e.g. First comment for poster "Welcome Aboard"
    300th comment by poster "We love your stuff - keep posting". It could also be modifed to do something to add to activity comments as well.

    All cool. This plugin can be taken in thousands of directions, for faqs, links messaging emailing etc.

    This plugin has proven to be alot of fun.

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

  • rbrahmsonrbrahmson ✭✭✭
    edited March 2014
    Very interesting plugin but I wonder whether the current setup that requires coding the dialog within distinctively named functions and remembering to add their names in another PHP file effectively restricts it's practical use to programmers...

    So here is a thought about making its use more widespread and perhaps elevate it from a fun thing to more practical uses (I leave it to the community to come with use case ideas):  separate the dialog from the functions and use a simple text file to define the dialogs.  Each dialog starts with a trigger phrase:

    ?Trigger-Phrase
       !Bot-Reply
       -Additional bot text lines
       ?In-dialog-Trigger-Phrase
       !Bot-follow-up
       <<multiple in-dialog triggers and follow up pairs may be entered>>
    ?Trigger-Phrase#2
       !Bot-Reply
       -Additional bot text lines
       ?In-dialog-Trigger-Phrase
       !Bot-follow-up
       <<multiple in-dialog triggers and follow up pairs may be entered>>
    ?Trigger-Phrase# and so forth

    This structure allows for:
    1. Separation between in-dialog user trigger-phrases and dialog triggering questions. Namely, a triggering phrase that starts a dialog is not confused with an in-dialog phrase.  The same trigger phrase could have different bot responses based on "context".  Not real AI, but  good fake...
    2. The Bot reply (prefixed with !) can be followed up with multiple text lines (marked by the dash). 
    3. To clarify, within a dialog, when the user enters a response, only the matching follow-up questions are compared.  So if the Bot offers a response that asks "Yes or No" and the dialog definitions has different possible follow up trigger phrases of Yes and No, then the responses by the Bot would be defined by the nested Yes and No segments. This of course allow for multiple choice selections (select 1, 2, or 3).

    Here is a simple example (you can think of better use cases-I'm not claiming tutorial should be done as a bot dialog):

    ?Forum Help 
     !Select from one of these options:
     -1. Starting a discussion
     -2. Commenting on a discussion
     -3. Following a discussion (bookmarks, notifications)
     -4. This forum etiquette
     -Select 1, 2, 3, 4, or just continue with the dialog
       ?1
       !To start a discussion click on the Start a New Discussion button on the right.
       !But before you do that I recommend checking if a discussion on the same 
       !subject already exists. Adding a comment to an existing discussion of the same
       !subject offers you instant insight to what others wrote about it and a likely more
       !engaged audience.
       ?2
       !Select a discussion you want to comment on and add your comments at the bottom
       !within the Write  Comment box. Don't forget to click on the Post Comment button.
       ?3
       !You can bookmark a discussion by clicking on the star.  Bookmarked discussions will
       !appear on the right panel.  You can also follow discussions by going to your profile and
       !select the "My Preferences" on the left to subscribe and be notified on different discussions.
       ?4
       !This forum etiquette - Don't do unto others what you don't want others to do unto you 
    ?Who is online right now?
     !I am, you are, and possibly others - look at the sidebar for online users
     ?Who are you?
      !I am the master of the universe (this forum universe but I tend to exaggerate)
      ?thanks
      !You are welcome

    And a dialog:
    User: Forum Help
    System: Select from one of these options:
     1. Starting a discussion
     2. Commenting on a discussion
     3. Following a discussion (bookmarks, notifications)
     4. This forum etiquette
     Select 1, 2, 3, 4, or just continue with the dialog
    User: 1
    System: To start a discussion click on the Start a New Discussion button on the right.
       But before you do that I recommend checking if a discussion on the same 
       subject already exists. Adding a comment to an existing discussion of the same
       subject offers you instant insight to what others wrote about it and a likely more
       engaged audience.
  • @rbrahmson‌ potential counterpoints:

    • This requires a user to learn a new syntax that is only used here
    • You now have to handle escaping each character that is considered special
    • This doesn't allow for any type of variable response
    • There is no conditional checking for anything other than making a response tree

    In my mind, this would make creating a response tree easier but it wouldn't help in any other case. If you do want something that is easier to write, maybe look into JSON objects?

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • chanhchanh ✭✭

    This is very interesting concept! bot auto reply to message! I will surely take a closer look.

    Thanks

  • rbrahmsonrbrahmson ✭✭✭

    @hgtonight offered very good points that deserve feedback, so here it is:

    First, I am of the opinion/vision that Vanilla can/should be used by forum administrators that do not need to have programming skills. With all due respect to programmers (and they do deserve the respect), there is a larger community out there and I hope to bring Vanilla to a wider audience. Thus all solutions that require the use of PHP, JSON objects and other tools of the trade limit solutions to a smaller audience than I envision.

    • @hgtonight: This requires a user to learn a new syntax that is only used here

    Indeed, but that syntax is intentionally simple and is intended for non-programmer administrators.
    I am not married to this syntax, just offering a sample suggestion for a simple syntax.

    • @hgtonight: You now have to handle escaping each character that is considered special

    True, but that is always the first non-blank character in the line so it's not that hard to parse. But again, I am not married to that specific syntax, merely offering an example.

    • @hgtonight: This doesn't allow for any type of variable response

    Also True, but I am not looking for a full-blown language. For that there is PHP...

    I want to take advantage of @hgtonight's use of the term "variable" into another meaning -- that I have not offered variable substitutions. That is intentional for I make the case that variable substitution should not be limited to the BOT -- it should work everywhere (and how to do that can be discussed &elsewhere;-) -- there may be another plugin for that.

    • @hgtonight: There is no conditional checking for anything other than making a response tree. In my mind, this would make creating a response tree easier but it wouldn't help in any other case. If you do want something that is easier to write, maybe look into JSON objects?

    Again, I am intentionally looking for simplicity for the non-programmers audience.

  • @rbrahmson‌ Fair points.

    My take on this is that your proposal (single text file with a simple markup) doesn't go far enough for the non-programmer audience. It still requires you learn something to program the bot. What's worse is that it uses a custom markup language so there is no hope someone already knows it.

    I would suggest creating a nice GUI for creating response trees that compiles a botreplies.php file. Something simple yet powerful like a couple of text boxes. Everyone that can use a forum already knows how to use those. Then add in a drag'n'drop list for re-ordering the reply order. This all could be done via a plugin called Basic Response Trees that depend on schwaip bot plugin.

    This xkcd comes to mind:

    All that said. I think it is a good idea to create a better user experience for forum admins.

    Search first

    Check out the Documentation! We are always looking for new content and pull requests.

    Click on insightful, awesome, and funny reactions to thank community volunteers for their valuable posts.

  • rbrahmsonrbrahmson ✭✭✭

    @hgtonight: Very good point which I wholly accept. I was looking for something simpler than PHP and you leapfrogged me with an interactive dialog which is way better because it shields the admins from the syntax question altogether. Anything that reduces the forum admins learning curve!

    And BTW, this is/was a very good dialog- I wish there were more participants in that dialog...

Sign In or Register to comment.