Slack v0.23.5 Slack.Bot View Source

This module is used to spawn bots and is used to manage the connection to Slack while delegating events to the specified bot module.

Link to this section Summary

Functions

Connects to Slack and delegates events to bot_handler

Link to this section Functions

Link to this function

start_link(bot_handler, initial_state, token, options \\ %{}) View Source

Connects to Slack and delegates events to bot_handler.

Options

  • keepalive - How long to wait for the connection to respond before the client kills the connection.
  • name - registers a name for the process with the given atom

Example

{:ok, pid} = Slack.Bot.start_link(MyBot, [1,2,3], "abc-123", %{name: :slack_bot})

:sys.get_state(:slack_bot)