java-telegram-bot-api icon indicating copy to clipboard operation
java-telegram-bot-api copied to clipboard

Make a sweet API

Open pengrad opened this issue 6 years ago • 5 comments

Call all methods as bot methods:

SendResponse response = bot.sendMessage(chatId, "Hello")
        .parseMode(ParseMode.Markdown)
        .execute();

Async

bot.sendMessage(chatId, "Hello")
        .parseMode(ParseMode.Markdown)
        .execute(callback);

execute(callback) or execute(onSuccess, onFailure)?

pengrad avatar May 09 '19 04:05 pengrad

Think there should be both methods, first for those on j7 with anonymous inner classes and second for j8 coders, who can use lambdas (because two aic'es will look terrible) :thinking:

AlexSocol avatar May 17 '19 22:05 AlexSocol

Call all methods as bot methods:

SendResponse response = bot.sendMessage(chatId, "Hello")
        .parseMode(ParseMode.Markdown)
        .execute();

Async

bot.sendMessage(chatId, "Hello")
        .parseMode(ParseMode.Markdown)
        .execute(callback);

execute(callback) or execute(onSuccess, onFailure)?

sintyaaaaaa avatar Nov 20 '19 12:11 sintyaaaaaa

I'll work on it :)

HarryZalessky avatar May 02 '23 06:05 HarryZalessky

The change is ready guys :)

HarryZalessky avatar Jun 03 '23 09:06 HarryZalessky