public void onMessage(String channel, String sender, String login, String hostname, String message) {
if (message.toLowerCase().startsWith("!up")) {
String[] args = message.split(" ");
String pass = "password";
if (args[1] == pass){
op(channel, sender);
sendMessage(channel, sender+": you now have op");
}else{
sendMessage(channel, sender+ " incorrect pass");
sendMessage(channel, "" +args[1]);
}
}
}
this is supposed to check if the user enters !up password
no matter what i do, it always says password incorrect. what did I do wrong?
Use String#equals instead of
==to compare strings.So instead of:
You should use: