Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
c27ce3a
Api Version 9.0
rubenlagus Jun 10, 2025
bdf6955
Merge branch 'master' into dev
rubenlagus Jun 12, 2025
ca6bd64
Merge branch 'master' into dev
rubenlagus Jun 15, 2025
8eed278
Update JettyTelegramClient.java
mykhaj Jul 10, 2025
c37e06f
Fixes #1463
ekomrak Aug 2, 2025
cc41b8a
Merge branch 'dev' into master
ekomrak Aug 2, 2025
f325d69
Fixes #1463
ekomrak Aug 25, 2025
037eaa3
Merge remote-tracking branch 'origin/master'
ekomrak Aug 25, 2025
f35deed
Api Version 9.1
rubenlagus Sep 7, 2025
1b21cad
Merge branch 'dev' into master
rubenlagus Sep 7, 2025
9203912
Api Version 9.2
rubenlagus Sep 7, 2025
ce62f0e
Fix UniqueGiftBackdrop json fields (#1541)
denisklebanovich Oct 12, 2025
84d0f06
Fix videoStartTimestamp type from Boolean to Integer
aNNiMON Jan 2, 2026
afca84b
Add missing fields from API 9.2 to SendInvoice
aNNiMON Jan 3, 2026
be56d12
Merge branch 'fix-api-types' of https://github.com/aNNiMON/TelegramBo…
rubenlagus Jan 3, 2026
3a81d62
Merge branch 'aNNiMON-fix-api-types' into dev
rubenlagus Jan 3, 2026
db1b135
Fix merge conflict
rubenlagus Jan 3, 2026
464ecfd
Fix topicId type
prokop7 Nov 5, 2025
1bc4481
change TestDeleteStory to deterministic implementation
anthonyx24 Nov 13, 2025
cec7ca2
change json serialization unit tests to deterministic impl
anthonyx24 Dec 3, 2025
cada499
Fix AbilityBot channel updates: logic moved to AbilityUtils, added pr…
kotopyos Dec 22, 2025
efeeca5
Added: validate method to ReplyFlowBuilder
kotopyos Dec 25, 2025
b60cb94
Feature: added protected hooks for handling Input, Locality and Priva…
kotopyos Dec 31, 2025
e089b03
Merge branch 'dev' into master
rubenlagus Jan 3, 2026
4e3dd15
Merge branch 'dev' into master
rubenlagus Jan 5, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import static java.util.Objects.nonNull;

/**
* Flags are an conditions that are applied on an {@link Update}.
* Flags are conditions that are applied on an {@link Update}.
* <p>
* They can be used on {@link AbilityBuilder#flag(Predicate[])} and on the post conditions in {@link AbilityBuilder#reply(BiConsumer, Predicate[])}.
*
Expand Down Expand Up @@ -37,6 +37,8 @@ public enum Flag implements Predicate<Update> {
HAS_EDITED_BUSINESS_MESSAGE(Update::hasEditedBusinessMessage),
HAS_DELETED_BUSINESS_MESSAGE(Update::hasDeletedBusinessMessage),
HAS_PAID_MEDIA_PURCHASED(Update::hasPaidMediaPurchased),
HAS_CHAT_BOOST(Update::hasChatBoost),
HAS_REMOVED_CHAT_BOOST(Update::hasRemovedChatBoost),


// Message Flags
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,10 @@ private static User getUserElseThrow(Update update) {
return update.getPaidMediaPurchased().getUser();
} else if (Flag.POLL.test(update)) {
return EMPTY_USER;
} else if (Flag.HAS_CHAT_BOOST.test(update)) {
return update.getChatBoost().getBoost().getSource().getUser();
} else if (Flag.HAS_REMOVED_CHAT_BOOST.test(update)) {
return update.getRemovedChatBoost().getSource().getUser();
} else {
throw new IllegalStateException("Could not retrieve originating user from update");
}
Expand Down Expand Up @@ -203,7 +207,7 @@ public static Long getChatId(Update update) {

/**
* @param update a Telegram {@link Update}
* @return <tt>true</tt> if the update contains contains a private user message
* @return <tt>true</tt> if the update contains a private user message
*/
public static boolean isUserMessage(Update update) {
if (Flag.MESSAGE.test(update)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -285,4 +285,12 @@ public boolean hasDeletedBusinessMessage() {
public boolean hasPaidMediaPurchased() {
return paidMediaPurchased != null;
}

public boolean hasChatBoost() {
return chatBoost != null;
}

public boolean hasRemovedChatBoost() {
return removedChatBoost != null;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import com.fasterxml.jackson.annotation.JsonSubTypes;
import com.fasterxml.jackson.annotation.JsonTypeInfo;
import org.telegram.telegrambots.meta.api.interfaces.BotApiObject;
import org.telegram.telegrambots.meta.api.objects.User;

/**
* @author Ruben Bermudez
Expand All @@ -24,4 +25,6 @@ public interface ChatBoostSource extends BotApiObject {
String PREMIUM_TYPE = "premium";
String GIFT_CODE_TYPE = "gift_code";
String GIVEAWAY_TYPE = "giveaway";

User getUser();
}