Login to muc with exmpp

Hello,

How can i login with exmpp bot to multi user chat room?

Thank you.

I try to

I try to use:

create_move_room (Room, Username) ->
#xmlel {name=presence, attrs=[#xmlattr{name = to,
value = list_to_binary(Room ++ "@" ++ ?JABBER_MUC_HOST ++ "/"
++ Username)}],
children=[#xmlel{name=x,
attrs=[#xmlattr{name=xmlns, value="?MUC"}]}]}.

But get error:

** Reason for termination =
** {badarg,[{erlang,binary_to_list,[to]},
{exmpp_xml,xmlnsattributes_to_xmlattributes2,3},
{exmpp_xml,unresolve_xmlel_nss,3},
{exmpp_xml,node_to_iolist2,4},
{exmpp_xml,node_to_binary,3},
{exmpp_socket,send,2},
{exmpp_session,send_packet,3},
{exmpp_session,logged_in,3}]}

I try to

I try to use:

create_move_room (Room, Username) ->
#xmlel {name=presence, attrs=[#xmlattr{name = to,
value = list_to_binary(Room ++ "@" ++ ?JABBER_MUC_HOST ++ "/"++Username)}],
children=[#xmlel{name=x,attrs=[#xmlattr{name=xmlns, value="?MUC"}]}]}.

But get error:

** Reason for termination =
** {badarg,[{erlang,binary_to_list,[to]},
{exmpp_xml,xmlnsattributes_to_xmlattributes2,3},
{exmpp_xml,unresolve_xmlel_nss,3},
{exmpp_xml,node_to_iolist2,4},
{exmpp_xml,node_to_binary,3},
{exmpp_socket,send,2},
{exmpp_session,send_packet,3},
{exmpp_session,logged_in,3}]}

Error

I try to use:

create_move_room (Room, Username) ->
#xmlel {name=presence, attrs=[#xmlattr{name = to,
value = list_to_binary(Room ++ "@" ++ ?JABBER_MUC_HOST ++ "/"++Username)}],
children=[#xmlel{name=x,attrs=[#xmlattr{name=xmlns, value="?MUC"}]}]}.

But get error:

** Reason for termination =
** {badarg,[{erlang,binary_to_list,[to]},
{exmpp_xml,xmlnsattributes_to_xmlattributes2,3},
{exmpp_xml,unresolve_xmlel_nss,3},
{exmpp_xml,node_to_iolist2,4},
{exmpp_xml,node_to_binary,3},
{exmpp_socket,send,2},
{exmpp_session,send_packet,3},
{exmpp_session,logged_in,3}]}

Error

I try to use:

create_move_room (Room, Username) ->
#xmlel {name=presence, attrs=[#xmlattr{name = to,
value = list_to_binary(Room ++ "@" ++ ?JABBER_MUC_HOST ++ "/"++Username)}],
children=[#xmlel{name=x,attrs=[#xmlattr{name=xmlns, value="?MUC"}]}]}.

But get error:

** Reason for termination =
** {badarg,[{erlang,binary_to_list,[to]},
{exmpp_xml,xmlnsattributes_to_xmlattributes2,3},
{exmpp_xml,unresolve_xmlel_nss,3},
{exmpp_xml,node_to_iolist2,4},
{exmpp_xml,node_to_binary,3},
{exmpp_socket,send,2},
{exmpp_session,send_packet,3},
{exmpp_session,logged_in,3}]}

I try to

I try to use:

create_move_room (Room, Username) ->
#xmlel {name=presence, attrs=[#xmlattr{name = to,
value = list_to_binary(Room ++ "@" ++ ?JABBER_MUC_HOST ++ "/"
++ Username)}],
children=[#xmlel{name=x,
attrs=[#xmlattr{name=xmlns, value="?MUC"}]}]}.

But get error:

** Reason for termination =
** {badarg,[{erlang,binary_to_list,[to]},
{exmpp_xml,xmlnsattributes_to_xmlattributes2,3},
{exmpp_xml,unresolve_xmlel_nss,3},
{exmpp_xml,node_to_iolist2,4},
{exmpp_xml,node_to_binary,3},
{exmpp_socket,send,2},
{exmpp_session,send_packet,3},
{exmpp_session,logged_in,3}]}

Syndicate content