Closed colinrymer closed 7 years ago
Hi @colinrymer, the README is currently incorrect. Previously, I was auto-registering clients and have since removed that in order to ensure more flexibility.
The current solution is to do this in the after_connect/1
callback in your robot module.
defmodule MyApp.Robot do
use Hedwig.Robot, otp_app: :my_app
def after_connect(state) do
Hedwig.Registry.register(state.name)
{:ok, state}
end
end
Sorry for the confusion. I'll update the README.
Updated the README. Thanks for the report @colinrymer!
A bot started with
Hedwig.start_robot/2
or through the supervision tree doesn't register as a named process.If you try calling
Hedwig/which_robots/0
, you get a return that looks like: