All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.pengrad.telegrambot.TelegramBot Maven / Gradle / Ivy

There is a newer version: 7.11.0
Show newest version
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