marvin v0.3.1 Marvin.Bot

Bot is a module designed to be used in the bots built with Marvin.

When you use this module you can make your bot respond to different types of messages from your Slack account.

## Example

defmodule EchoBot do
    use Marvin.Bot

    match {:direct, ~r/^hello/}

    def handle_message(message, slack) do
      send_message(message.text, message.channel, slack)
    end
  end

In this example the bot is listening for mentions that include the phrase “hello” (@yourbot / yourbot) and and for direct messages. It then takes the text from the received message and sending it back to the channel it came in from.

Summary

Functions

send_attachment(attachments, channel, slack)

Macros

match(match_pair)