import honk.apibot.irc.IrcCommandEvent;
/**
* Test plugin which replies to test and admin text with a short message.
*
* *
* Commands available
* test | | sends some text
* |
---|
admintest | * | sends some text
* |
---|
* * restricted
*
* @author honk
*/
public class TestPlugin implements Plugin {
/* (non-Javadoc)
* @see honk.apibot.irc.Plugin#getCommands()
*/
public String[] getCommands() {
return new String[] {
"test"
};
}
/* (non-Javadoc)
* @see honk.apibot.irc.Plugin#getRestrictedCommands()
*/
public String[] getRestrictedCommands() {
return new String[] {
"admintest"
};
}
/* (non-Javadoc)
* @see honk.apibot.irc.Plugin#handleEvent(honk.apibot.irc.IrcCommandEvent)
*/
public void handleEvent(IrcCommandEvent ice) {
if (ice.getCommand().equals("test")) {
ice.getSource().sendMessageTo(ice.getTarget().getDefaultTarget(), IrcSender.MessageTypes.PRIVMSG, "moo!");
} else if (ice.getCommand().equals("admintest")) {
ice.getSource().sendMessageTo(ice.getTarget().getDefaultTarget(), IrcSender.MessageTypes.PRIVMSG, "fierce moo!");
}
}
}