Packages

Generates a Slack bot boilerplate that works out of the box and is easily extensible. Support for cron-like jobs and commands included.

Current section

Files

Jump to
gen_template_slack_bot template $PROJECT_NAME$ config config.exs
Raw

template/$PROJECT_NAME$/config/config.exs

use Mix.Config
# configure responders
config :<%= @project_name %>, <%= @project_name_camel_case %>.Robot,
adapter: Hedwig.Adapters.Slack,
name: "<%= @project_name %>",
# aka: "!|<@U4D73B057>",
token: System.get_env("SLACK_TOKEN") || "not-a-key",
responders: [
{<%= @project_name_camel_case %>.Responders.CommitMsg, []},
]
# configure jobs
config :<%= @project_name %>, <%= @project_name_camel_case %>.Scheduler,
jobs: [
{"* * * * *", {<%= @project_name_camel_case %>.Jobs.Hello, :run, ["general"]}},
]