Command = #irc_command{command = "JOIN", middles = [Channel]},
send_command(Command).
-add_amqp_listener(Instance, ObjectSup) ->
+get_routing_key(Instance) ->
InstanceKey = irc_amqp_listener:encode_routing_key(atom_to_list(Instance)),
- RoutingKey = InstanceKey ++ ".output.*",
+ InstanceKey ++ ".output.*".
+
+add_amqp_listener(Instance, ObjectSup) ->
{ok, _ChildPid} = irc_object_sup:add_amqp_listener(
- ObjectSup, self(), RoutingKey).
+ ObjectSup, self(), get_routing_key(Instance)).
%% @doc Splits a buffer into full lines, keeping whatever is left over
%% Returns either {ok, [Line], Remaining} or none.