GLProgramming.com

home :: about :: development guides :: irc :: forums :: search :: paste :: links :: contribute :: code dump

-> Click here to learn how to get live help <-


New Paste :: Recent Pastes:: No Line Numbers


channels plugin by statler
1
 
/*
 * Module: net.statler.mupbot.plugins
 * Repository: $Source$
 * Created: Sep 6, 2004
 * Revision: $Revision$ | $Date$ | $Author$
 */

package net.statler.mupbot.plugins;

/**
 * @author setatum
 */
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);
        }
    } // onMessage
    
} // ChannelsPlugin


//
// $Log$
//