DasBot v0.1.1 DasBot.Slug.PipelineBuilder

Tools for building a pipeline of slugs. This is used by DasBot.Bot and isn’t intended to be used directly.

Link to this section Summary

Functions

Executes the module’s slug pipeline. Given an initial DasBot.Event, each slug will be executed, and the result of the slug’s execution will become the input for the next slug

Adds a slug to the module’s slug pipeline

Link to this section Types

Link to this type slug()
slug() :: module() | atom()

Link to this section Functions

Link to this function execute_pipeline(slugs, initial_event, bot_module)
execute_pipeline([slug()], DasBot.Event.t(), DasBot.Bot.t()) :: DasBot.Event.t()

Executes the module’s slug pipeline. Given an initial DasBot.Event, each slug will be executed, and the result of the slug’s execution will become the input for the next slug.

Link to this macro slug(slug) (macro)
slug(slug()) :: any()

Adds a slug to the module’s slug pipeline.

Example

defmodule MyPipeline do
  use DasBot.PipelineBuilder

  slug(ModulePlug)
  slug(:function_plug)

  def function_plug(event, _bot) do
    event
  end
end