I want to be able to disconnect a bot from any room, but with only my nick.
This is the code I've got:
if (message.equalsIgnoreCase("mybot")) { if (sender == "nathanlol"){ sendMessage(channel, sender + ": Ok, I will disconnect"); } else { sendMessage(channel, sender + "Nope"); } }
But in the channel, I'm getting this:
21:22 Nathanlol mybot
21:22 Nathanlol[eBot] NathanlolNope
21:22 Nathann mybot
21:22 Nathanlol[eBot] NathannNope
Notice I tried with two nicks, and they both give me the else message.
This is something else which came with the bot which works:
public void onMessage(String channel, String sender, String login, String hostname, String message) { if (message.equalsIgnoreCase("time")) { String time = new java.util.Date().toString(); sendMessage(channel, sender + ": The time is now " + time); }21:25 Nathanlol time
21:25 Nathanlol[eBot] Nathanlol: The time is now Thu Feb 16 21:25:47 UTC 2012
Am I doing something wrong?
Edited by Nathan, 16 February 2012 - 03:30 PM.