Closed cheeyeo closed 8 years ago
After further investigation, it does not appear this is due to the fact that I'm using the console adapter.
The same error appears when using the Hedwig Slack adapter too:
17:04:03.332 [error] Process #PID<0.245.0> raised an exception
** (UndefinedFunctionError) undefined function Hedwigslack.Robot.send/2
(hedwigslack) Hedwigslack.Robot.send(#PID<0.205.0>, %Hedwig.Message{matches: nil, private: %{}, ref: nil, robot: #PID<0.205.0>, room: "", text: "test text", type: "message", user: %Hedwig.User{id: nil, name: nil}})
(elixir) lib/stream.ex:454: anonymous fn/4 in Stream.map/2
(elixir) lib/stream.ex:1101: Stream.do_resource/5
(elixir) lib/stream.ex:1247: Enumerable.Stream.do_each/4
(elixir) lib/stream.ex:494: Stream.run/1
Hi there @cheeyeo, you're looking for Hedwig.Robot.send/2
. It takes the pid
of the robot and a %Hedwig.Message{}
.
Hope that helps.
Hi
I have followed the intro and created Alfred.Robot and I'm trying to get the bot to send messages from an OTP app.
Even though I can locate the bot using Hedwig.whereis("alfred"), it keeps crashing with the following error:
I'm not sure what I am missing??
The send function should be defined?