Reply bot for Discourse?

This is technically easy for someone with some Ruby programming experience. Just write a plugin, responding to the :post_created event, write some code like this:

DiscourseEvent.on(:post_created) do |*params|
    post, opt, user = params

    if post.raw.include "foo"
        PostCreator.create!(
             User.find_by(id: bot_id),
             topic_id: post.topic_id,
             raw: "bar",
        )
    end
end
4 Likes