27 lines
722 B
Java
27 lines
722 B
Java
|
package ru.bvn13.examples.bot;
|
||
|
|
||
|
import org.telegram.telegrambots.ApiContextInitializer;
|
||
|
import org.telegram.telegrambots.TelegramBotsApi;
|
||
|
import org.telegram.telegrambots.exceptions.TelegramApiException;
|
||
|
|
||
|
/**
|
||
|
* Created by bvn13 on 21.02.2018.
|
||
|
*/
|
||
|
public class Application {
|
||
|
public static void main(String[] args) {
|
||
|
// Initialize Api Context
|
||
|
ApiContextInitializer.init();
|
||
|
|
||
|
// Instantiate Telegram Bots API
|
||
|
TelegramBotsApi botsApi = new TelegramBotsApi();
|
||
|
|
||
|
// Register our bot
|
||
|
MenuBot bot = new MenuBot();
|
||
|
bot.init();
|
||
|
try {
|
||
|
botsApi.registerBot(bot);
|
||
|
} catch (TelegramApiException e) {
|
||
|
e.printStackTrace();
|
||
|
}
|
||
|
}
|
||
|
}
|