I have this code with a if statement which is trying to get the user to input yes or no if the user inputs anything other than yes the request is denied. This is the error I get:
** exception error: no match of right hand side value "yes\n"
in function messenger:requestChat/1 (messenger.erl, line 80)
Code here:
requestChat(ToName) ->
case whereis(mess_client) of
undefined ->
not_logged_on;
_ -> mess_client ! {request_to, ToName},
request_to = io:get_line("Do you want to chat?"),
{_, Input} = request_to,
if(Input == yes) ->
ok;
true -> {error, does_not_want_to_chat}
end
end.