Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Vanilla System Bot

Hello. I would like to make use of the System Bot for Vanilla. I heard in another discussion similar to this I created and they said to use addons. I searched, but could not see any that could allow you to use the System Bot in the self managed version of Vanilla. And, if I were to create an addon to be able to do this, what code would I use to allow the System Bot to do this in a discussion: "@System CLOSE DISCUSSION"?

«1

Comments

  • That's a plugin named "Minion" that @Tim wrote. I have no idea if he plans to release it as open source ever, but I assume he would've done so already if he intended to.

    I'll say this: it's not a terribly complicated thing if you wanted to take a crack at making one.

  • LincLinc Admin
    edited January 2014

    Tim is already giving me shit about implying Minion is simple, so I will clarify: the parts you've see for show on this site are simple to do. Minion has actually grown into a crazy complicated beast of a plugin that does a lot of things. It's primarily used by Penny Arcade on their forum.

  • TimTim Vanilla Staff

    Currently no plans to release Minion as an open source plugin, but as @Lincoln said the small amount of functionality you're looking for to support closing discussions is extremely easy.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • TimTim Vanilla Staff

    I hook into this event for my parsing:

    PostController_AfterDiscussionSave_Handler

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • I imagine the recently released Shwaip Bot plugin by @Lincoln would be an excellent starting point as well.

    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.

  • @Tim @Lincoln I cannot find it on the Addons page: "Minion" (without quotations)



    @hgtonight I will see if it works and report back. Thanks!

  • TimTim Vanilla Staff

    @ilovetech please see my post above where I explicitly state that I do NOT plan to release Minion for general download.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • @hgtonight @Lincoln What code do I add to be able to make it close discussions, and announce discussions?

  • You'll need to do some investigation to accomplish this. We're not going to explain how to build it line-by-line.

  • You would want to find the discussion ID, instantiate the discussion model, then set the close and announce discussions as appropriate.

    In any case where you are using functionality that already exists, you can "cheat" and copy the existing controller code into your plugin. For example, to close a discussion, you normally click on the Close link in the discussion options menu. Inspecting this link shows it is in the form of http://forum.example.com/vanilla/discussion/close/2/P5OIKA0AI4D8. This tells us we need to go to the vanilla application, find the discussion controller, and inspect the Close() method. In the case of 2.0.18.10, you will find it on line 480 of the class.discussioncontroller.php file.

    You basically can copy that method into your plugin (ignore the rendering and redirecting code).

    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.

  • @Tim did minion grow into something like this? :)

  • TimTim Vanilla Staff

    Lol. Minion core is about 2,500 lines of code but I have coded several plugins for it which add new commands and functionality, including some games, so I'd have to say its sitting at around 10,000 LOC if you include all the various addons.

    Crazy.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • @Tim Well, when can I download it?

  • Well, I do understand your last post about it @Tim, but I'm asking about Private Downloads

  • TimTim Vanilla Staff

    Unfortunately you can't download it.

    Vanilla Forums COO [GitHub, Twitter, About.me]

  • @Tim said:
    Lol. Minion core is about 2,500 lines of code but I have coded several plugins for it which add new commands and functionality, including some games, so I'd have to say its sitting at around 10,000 LOC if you include all the various addons.

    Crazy.

    I thought it was worse. My Awards plugin is about 12000, a plugin I wrote for Captain Hook (i.e. WordPress) is 18000. :D

  • @hgtonight I got the data. There's just one part I am trying hard to find. "How to limit it to Admins and staff"

  • edited January 2014

    You can do a conditional check on the user ID or role IDs of the user of a post or if the user of a post has a permission.

    Add Pages to Vanilla with the Basic Pages app

  • So: array('Garden.User.Announce'),



    At the beginning of the function code?

  • Something like:

    if(!Gdn::Session()->CheckPermission('Permission.To.Check')) return;
    

    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.

Sign In or Register to comment.