I want to write IRC Twitch bot. I have never used Pirc library before, so i wrote this simple bot to get started.
BasicBot class :
public class BasicBot extends PircBot{
public BasicBot(String name){
super();
this.setName(name);
}
protected void onMessage(String channel, String sender, String login, String hostname, String message) {
if(message == "2/10"){
sendMessage(channel,"YAYO");
}
System.out.println(message + (message == "2/10"));
}
}
but when message 2/10 appears on chat this is what i see in console :
2/10false
I don't know why "2/10" == "2/10"
is false
. I tried also other strings like "banana"
or "apple"
and result was similar. Please help.