You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

49 lines
1.7 KiB

11 years ago
package org.telegram;
import org.telegram.telegrambots.TelegramApiException;
import org.telegram.telegrambots.TelegramBotsApi;
import org.telegram.telegrambots.logging.BotLogger;
import org.telegram.telegrambots.logging.BotsFileHandler;
import org.telegram.updateshandlers.ChannelHandlers;
import org.telegram.updateshandlers.DirectionsHandlers;
import org.telegram.updateshandlers.FilesHandlers;
import org.telegram.updateshandlers.RaeHandlers;
import org.telegram.updateshandlers.TransifexHandlers;
import org.telegram.updateshandlers.WeatherHandlers;
import java.io.IOException;
import java.util.logging.ConsoleHandler;
import java.util.logging.Level;
11 years ago
/**
* @author Ruben Bermudez
* @version 1.0
* @brief Main class to create all bots
* @date 20 of June of 2015
*/
public class Main {
private static final String LOGTAG = "MAIN";
11 years ago
public static void main(String[] args) {
BotLogger.setLevel(Level.ALL);
BotLogger.registerLogger(new ConsoleHandler());
try {
BotLogger.registerLogger(new BotsFileHandler());
} catch (IOException e) {
BotLogger.severe("MAIN", e);
}
TelegramBotsApi telegramBotsApi = new TelegramBotsApi();
try {
telegramBotsApi.registerBot(new ChannelHandlers());
telegramBotsApi.registerBot(new DirectionsHandlers());
telegramBotsApi.registerBot(new RaeHandlers());
telegramBotsApi.registerBot(new WeatherHandlers());
telegramBotsApi.registerBot(new TransifexHandlers());
telegramBotsApi.registerBot(new FilesHandlers());
} catch (TelegramApiException e) {
BotLogger.error(LOGTAG, e);
}
11 years ago
}
}