Welcome to marvin’s documentation!

Marvin is a Haskell framework for creating chat bots, inspired by Hubot. Marvin aims to recreate the ease of use and straightforward API of Hubot, and combine it with the safety guarantees and purity of Haskell and the higher efficiency.

If you are new to marvin you may want to begin with the Getting started section or the how to script with marvin section to get a sense of how scripting works with marvin.

A quick snippet of code

module MyScript where

import Marvin.Prelude

script :: IsAdapter a => ScriptInit a
script = defineScript "my-script" $ do
    hear "sudo (.+)" $ do
        match <- getMatch

        reply $(isL "All right, i'll do #{match !! 1}")

    respond "repeat" $ do
        message <- getMessage

        send $(isL "You wrote #{message}")

    respond "what is in file (\\w+)\\??" $ do
        match <- getMatch
        let file = match !! 1

        contents <- liftIO $ readFile file

        send contents

    enterIn "#random" $ do
        user <- getUser
        username <- getUsername user

        send $(isL "Hello #{username} welcome to the random channel!")

Testing and Talking

There’s a slack channel where you can ask questions or play around with a test instance of marvin.

It’s currently invite-only, so send me an email if you would like to join.

Indices and tables