com.pengrad.telegrambot.TelegramBot Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of java-telegram-bot-api Show documentation
Show all versions of java-telegram-bot-api Show documentation
Java API for Telegram Bot API
package com.pengrad.telegrambot;
import com.pengrad.telegrambot.impl.FileApi;
import com.pengrad.telegrambot.impl.TelegramBotClient;
import com.pengrad.telegrambot.model.File;
import com.pengrad.telegrambot.request.BaseRequest;
import com.pengrad.telegrambot.response.BaseResponse;
/**
* Stas Parshin
* 16 October 2015
*/
public class TelegramBot extends OldTelegramBot {
private final TelegramBotClient api;
private final FileApi fileApi;
TelegramBot(TelegramBotClient api, FileApi fileApi) {
super(fileApi);
this.api = api;
this.fileApi = fileApi;
}
public String getFullFilePath(File file) {
return fileApi.getFullFilePath(file.filePath());
}
@Override
public R execute(BaseRequest request) {
return api.send(request);
}
public , R extends BaseResponse> void execute(T request, Callback callback) {
api.send(request, callback);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy