Package com.uwyn.drone.modules

Source Code of com.uwyn.drone.modules.Identify

/*
* Copyright 2002-2005 Uwyn bvba/sprl <info[remove] at uwyn dot com>
* Distributed under the terms of the GNU Lesser General Public
* License, v2.1 or later
*
* $Id: Identify.java 2457 2005-09-15 15:52:18Z gbevin $
*/
package com.uwyn.drone.modules;

import com.uwyn.drone.core.AbstractModule;
import com.uwyn.drone.core.Bot;
import com.uwyn.drone.core.exceptions.CoreException;
import com.uwyn.drone.protocol.ServerMessage;
import com.uwyn.drone.protocol.commands.Privmsg;

public class Identify extends AbstractModule
{
  private static final String[]  NOTICE_COMMANDS = new String[] {"password"};
 
  private String mNick = null;
  private String mPassword = null;
 
  public void setNick(String nick)
  {
    mNick = nick;
  }
 
  public String getNick()
  {
    return mNick;
  }
 
  public void setPassword(String password)
  {
    mPassword = password;
  }
 
  public String getPassword()
  {
    return mPassword;
  }
 
  public String[] getNoticeCommands()
  {
    return NOTICE_COMMANDS;
  }
 
  public void noticeCommand(Bot bot, String nick, String command, String arguments, ServerMessage fullMessage)
  throws CoreException
  {
    bot.resumeLogon();
  }
 
  public void loggedon(Bot bot)
  throws CoreException
  {
    bot.suspendLogon();
    bot.send(new Privmsg(mNick, "identify "+mPassword));
  }
}
TOP

Related Classes of com.uwyn.drone.modules.Identify

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.