hedwig-im / hedwig

An Adapter-based Bot Framework for Elixir Applications
MIT License
656 stars 73 forks source link

Support multiple configurations of the same adapter #49

Closed enilsen16 closed 8 years ago

enilsen16 commented 8 years ago

For example --

config :eva, Eva.Robot,
  adapter: Hedwig.Adapters.Slack,
  name: "Ava",
  aka: "/",
  token: "",
  # for now, you can invite your bot to a channel in slack and it will join
  # automatically
  rooms: [],
  responders: [
    {Hedwig.Responders.Help, []},
    {Hedwig.Responders.GreatSuccess, []},
    {Hedwig.Responders.ShipIt, []}
  ]

config :eva, Eva.Robot,
  adapter: Hedwig.Adapters.Slack,
  name: "Eva",
  aka: "/",
    # fill in the appropriate API token for your bot
  token: "",
  # for now, you can invite your bot to a channel in slack and it will join
  # automatically
  rooms: [],
  responders: [
    {Hedwig.Responders.Help, []},
    {Hedwig.Responders.GreatSuccess, []},
    {Hedwig.Responders.ShipIt, []}
  ]
scrogson commented 8 years ago

Hi @enilsen16,

Hedwig already supports dynamic configuration at runtime. Check out this section in the README. I believe the only thing that is compile-time is the adapter. So you can simply pass in a name: "Eva" into the options and it will be merged with the what's in your config.

What you are suggesting is just not possible.