// --------------------------------------------------------------------------
// Copyright (C) 2012-2013 Best-Ever
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// --------------------------------------------------------------------------

package org.bestever.bebot;

import java.util.TimerTask;

/**
 * Class that runs timed broadcasts (notices, etc)
 */
public class NoticeTimer extends TimerTask {

	/**
	 * Holds the bot
	 */
	private Bot bot;

	/**
	 * Constructor
	 * @param bot Bot - the main bot object
	 */
	public NoticeTimer(Bot bot) {
		this.bot = bot;
	}

	/**
	 * Send a message to all servers
	 */
	public void run() {
		for (Server s : bot.servers)
			s.in.println("say " + bot.cfg_data.bot_notice);
	}
}
