Vibe.Session.Command.Command behaviour (vibe v0.2.1)

Copy Markdown View Source

Slash command: /command — run a shell command.

Summary

Types

result()

@type result() ::
  {:events, [Vibe.Event.t()]}
  | {:command, atom() | {atom(), map()}}
  | :compact
  | :ignore

spec()

@type spec() ::
  Vibe.Session.Command.Spec.t()
  | %{
      :name => String.t(),
      optional(:aliases) => [String.t()],
      optional(:description) => String.t(),
      optional(:selectors) => [atom()]
    }

Callbacks

run(t, map)

@callback run(String.t(), map()) :: result()

selector_action(term, map)

(optional)
@callback selector_action(term(), map()) :: result() | {:command, String.t()}

spec()

@callback spec() :: spec()