Skip to content

Commit fffa586

Browse files
committed
Add and deprecate Integer constructor in Topic methods
1 parent d5e8696 commit fffa586

File tree

6 files changed

+81
-13
lines changed

6 files changed

+81
-13
lines changed

library/src/main/java/com/pengrad/telegrambot/request/CloseForumTopic.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
import com.pengrad.telegrambot.response.BaseResponse;
44

55
public class CloseForumTopic extends BaseRequest<CloseForumTopic, BaseResponse> {
6+
7+
/**
8+
* @deprecated use constructor with Long for future compatibility
9+
*/
10+
@Deprecated
11+
public CloseForumTopic(Integer chatId, Integer messageThreadId) {
12+
super(BaseResponse.class);
13+
add("chat_id", chatId);
14+
add("message_thread_id", messageThreadId);
15+
}
16+
617
public CloseForumTopic(Long chatId, Integer messageThreadId) {
718
super(BaseResponse.class);
819
add("chat_id", chatId);

library/src/main/java/com/pengrad/telegrambot/request/CreateForumTopic.java

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,11 @@
44

55
public class CreateForumTopic extends BaseRequest<CreateForumTopic, CreateForumTopicResponse> {
66

7-
public CreateForumTopic(String chatId, String name) {
7+
/**
8+
* @deprecated use constructor with Long for future compatibility
9+
*/
10+
@Deprecated
11+
public CreateForumTopic(Integer chatId, String name) {
812
super(CreateForumTopicResponse.class);
913
add("chat_id", chatId);
1014
add("name", name);
@@ -16,6 +20,12 @@ public CreateForumTopic(Long chatId, String name) {
1620
add("name", name);
1721
}
1822

23+
public CreateForumTopic(String chatId, String name) {
24+
super(CreateForumTopicResponse.class);
25+
add("chat_id", chatId);
26+
add("name", name);
27+
}
28+
1929
public CreateForumTopic iconColor(Integer iconColor) {
2030
add("icon_color", iconColor);
2131
return this;

library/src/main/java/com/pengrad/telegrambot/request/DeleteForumTopic.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
import com.pengrad.telegrambot.response.BaseResponse;
44

55
public class DeleteForumTopic extends BaseRequest<DeleteForumTopic, BaseResponse> {
6+
7+
/**
8+
* @deprecated use constructor with Long for future compatibility
9+
*/
10+
@Deprecated
11+
public DeleteForumTopic(Integer chatId, Integer messageThreadId) {
12+
super(BaseResponse.class);
13+
add("chat_id", chatId);
14+
add("message_thread_id", messageThreadId);
15+
}
16+
617
public DeleteForumTopic(Long chatId, Integer messageThreadId) {
718
super(BaseResponse.class);
819
add("chat_id", chatId);

library/src/main/java/com/pengrad/telegrambot/request/EditForumTopic.java

Lines changed: 26 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,35 +4,49 @@
44

55
public class EditForumTopic extends BaseRequest<EditForumTopic, BaseResponse> {
66

7-
public EditForumTopic(Long chatId,
8-
Integer messageThreadId) {
7+
/**
8+
* @deprecated use constructor with Long for future compatibility
9+
*/
10+
@Deprecated
11+
public EditForumTopic(Integer chatId, Integer messageThreadId) {
912
super(BaseResponse.class);
1013
add("chat_id", chatId);
1114
add("message_thread_id", messageThreadId);
1215
}
1316

14-
public EditForumTopic(String chatId,
15-
Integer messageThreadId) {
17+
public EditForumTopic(Long chatId, Integer messageThreadId) {
1618
super(BaseResponse.class);
1719
add("chat_id", chatId);
1820
add("message_thread_id", messageThreadId);
1921
}
2022

21-
public EditForumTopic(Long chatId,
22-
Integer messageThreadId,
23-
String name,
24-
String iconCustomEmojiId) {
23+
public EditForumTopic(String chatId, Integer messageThreadId) {
24+
super(BaseResponse.class);
25+
add("chat_id", chatId);
26+
add("message_thread_id", messageThreadId);
27+
}
28+
29+
/**
30+
* @deprecated use constructor with Long for future compatibility
31+
*/
32+
@Deprecated
33+
public EditForumTopic(Integer chatId, Integer messageThreadId, String name, String iconCustomEmojiId) {
34+
super(BaseResponse.class);
35+
add("chat_id", chatId);
36+
add("message_thread_id", messageThreadId);
37+
add("name", name);
38+
add("icon_custom_emoji_id", iconCustomEmojiId);
39+
}
40+
41+
public EditForumTopic(Long chatId, Integer messageThreadId, String name, String iconCustomEmojiId) {
2542
super(BaseResponse.class);
2643
add("chat_id", chatId);
2744
add("message_thread_id", messageThreadId);
2845
add("name", name);
2946
add("icon_custom_emoji_id", iconCustomEmojiId);
3047
}
3148

32-
public EditForumTopic(String chatId,
33-
Integer messageThreadId,
34-
String name,
35-
String iconCustomEmojiId) {
49+
public EditForumTopic(String chatId, Integer messageThreadId, String name, String iconCustomEmojiId) {
3650
super(BaseResponse.class);
3751
add("chat_id", chatId);
3852
add("message_thread_id", messageThreadId);

library/src/main/java/com/pengrad/telegrambot/request/ReopenForumTopic.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
import com.pengrad.telegrambot.response.BaseResponse;
44

55
public class ReopenForumTopic extends BaseRequest<ReopenForumTopic, BaseResponse> {
6+
7+
/**
8+
* @deprecated use constructor with Long for future compatibility
9+
*/
10+
@Deprecated
11+
public ReopenForumTopic(Integer chatId, Integer messageThreadId) {
12+
super(BaseResponse.class);
13+
add("chat_id", chatId);
14+
add("message_thread_id", messageThreadId);
15+
}
16+
617
public ReopenForumTopic(Long chatId, Integer messageThreadId) {
718
super(BaseResponse.class);
819
add("chat_id", chatId);

library/src/main/java/com/pengrad/telegrambot/request/UnpinAllForumTopicMessages.java

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,17 @@
33
import com.pengrad.telegrambot.response.BaseResponse;
44

55
public class UnpinAllForumTopicMessages extends BaseRequest<UnpinAllForumTopicMessages, BaseResponse> {
6+
7+
/**
8+
* @deprecated use constructor with Long for future compatibility
9+
*/
10+
@Deprecated
11+
public UnpinAllForumTopicMessages(Integer chatId, Integer messageThreadId) {
12+
super(BaseResponse.class);
13+
add("chat_id", chatId);
14+
add("message_thread_id", messageThreadId);
15+
}
16+
617
public UnpinAllForumTopicMessages(Long chatId, Integer messageThreadId) {
718
super(BaseResponse.class);
819
add("chat_id", chatId);

0 commit comments

Comments
 (0)