Package com.etsy.pushbot.command

Source Code of com.etsy.pushbot.command.HoldCommand

package com.etsy.pushbot.command;

import com.etsy.pushbot.*;
import com.etsy.pushbot.tokens.Hold;
import com.etsy.pushbot.tokens.MemberList;
import com.etsy.pushbot.tokens.PushToken;

public class HoldCommand
  extends TrainCommand {

  private String message;

  public HoldCommand() {}

  public void setMessage(String message) {
    this.message = message;
  }

  public void onCommand(PushBot pushBot,
                        PushTrain pushTrain,
                        String channel,
                        String sender) {
    Hold hold = new Hold();
    hold.setMessage(this.message);
    pushTrain.addFirst(hold);
  }

  @Override
  public String toString() {
    String s = "hold";
    if(message != null) {
      s += " " + message;
    }
    return s;
  }
}
TOP

Related Classes of com.etsy.pushbot.command.HoldCommand

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.