-
-
Notifications
You must be signed in to change notification settings - Fork 376
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #394 from mircoianese/api_v7.9
BOT API v7.9
- Loading branch information
Showing
15 changed files
with
123 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
27 changes: 27 additions & 0 deletions
27
library/src/main/java/com/pengrad/telegrambot/model/reaction/ReactionTypePaid.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package com.pengrad.telegrambot.model.reaction; | ||
|
||
import java.util.Objects; | ||
|
||
public class ReactionTypePaid extends ReactionType { | ||
|
||
public static final String PAID_TYPE = "paid"; | ||
|
||
public ReactionTypePaid() { | ||
super(PAID_TYPE); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object o) { | ||
if (this == o) return true; | ||
if (o == null || getClass() != o.getClass()) return false; | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return "ReactionTypePaid{" + | ||
"type='" + type() + '\'' + | ||
'}'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
library/src/main/java/com/pengrad/telegrambot/request/CreateChatSubscriptionInviteLink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
package com.pengrad.telegrambot.request; | ||
|
||
import com.pengrad.telegrambot.response.ChatInviteLinkResponse; | ||
|
||
/** | ||
* Stas Parshin | ||
* 10 March 2021 | ||
*/ | ||
public class CreateChatSubscriptionInviteLink extends BaseRequest<CreateChatSubscriptionInviteLink, ChatInviteLinkResponse> { | ||
|
||
/** | ||
* Create a subscription invite link for a channel chat. | ||
* | ||
* @param chatId Unique identifier for the target channel chat or username of the target channel (in the format @channelusername) | ||
* @param subscriptionPeriod The number of seconds the subscription will be active for before the next payment. Currently, it must always be 2592000 (30 days). | ||
* @param subscriptionPrice The amount of Telegram Stars a user must pay initially and after each subsequent subscription period to be a member of the chat; 1-2500 | ||
*/ | ||
public CreateChatSubscriptionInviteLink(Object chatId, Integer subscriptionPeriod, Integer subscriptionPrice) { | ||
super(ChatInviteLinkResponse.class); | ||
add("chat_id", chatId); | ||
add("subscription_period", subscriptionPeriod); | ||
add("subscription_price", subscriptionPrice); | ||
} | ||
|
||
/** | ||
* | ||
* @param name Invite link name; 0-32 characters | ||
*/ | ||
public CreateChatSubscriptionInviteLink name(String name) { | ||
return add("name", name); | ||
} | ||
|
||
|
||
} |
31 changes: 31 additions & 0 deletions
31
library/src/main/java/com/pengrad/telegrambot/request/EditChatSubscriptionInviteLink.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
package com.pengrad.telegrambot.request; | ||
|
||
import com.pengrad.telegrambot.response.ChatInviteLinkResponse; | ||
|
||
/** | ||
* Stas Parshin | ||
* 10 March 2021 | ||
*/ | ||
public class EditChatSubscriptionInviteLink extends BaseRequest<EditChatSubscriptionInviteLink, ChatInviteLinkResponse> { | ||
|
||
/** | ||
* Edit a subscription invite link created by the bot | ||
* @param chatId Unique identifier for the target chat or username of the target channel (in the format @channelusername) | ||
* @param inviteLink The invite link to edit | ||
*/ | ||
public EditChatSubscriptionInviteLink(Object chatId, String inviteLink) { | ||
super(ChatInviteLinkResponse.class); | ||
add("chat_id", chatId); | ||
add("invite_link", inviteLink); | ||
} | ||
|
||
/** | ||
* | ||
* @param name Invite link name; 0-32 characters | ||
* @return | ||
*/ | ||
public EditChatSubscriptionInviteLink name(String name) { | ||
return add("name", name); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters