package net.statler.mupbot.plugins;
public class ChannelsPlugin extends PluginBase
{
private String usage = "Usage: !part | !join <channel>";
public int getSupportedEvents()
{
return EVENT_MESSAGE;
}
public String[] getCommandsAccepted()
{
return new String[] { "part" };
}
public String getUsage()
{
return usage;
}
public String[] getHelp()
{
String[] help = new String[2];
help[0] = "Allows the user to command the bot to join/part channels.";
help[1] = usage;
return help;
}
public void onMessage(String channel, String sender,
String login, String hostname, String message)
{
if (message.toLowerCase().equals("!part"))
{
bot.partChannel(channel, "Commanded by " + sender);
}
} |