-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
28 changed files
with
652 additions
and
512 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
46 changes: 46 additions & 0 deletions
46
...a/com/annimon/tgbotsmodule/api/methods/forum/UnpinAllGeneralForumTopicMessagesMethod.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,46 @@ | ||
package com.annimon.tgbotsmodule.api.methods.forum; | ||
|
||
import com.annimon.tgbotsmodule.api.methods.interfaces.ChatMethod; | ||
import com.annimon.tgbotsmodule.services.CommonAbsSender; | ||
import java.util.function.Consumer; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.telegram.telegrambots.meta.api.methods.forum.UnpinAllGeneralForumTopicMessages; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class UnpinAllGeneralForumTopicMessagesMethod implements ChatMethod<UnpinAllGeneralForumTopicMessagesMethod, Boolean> { | ||
|
||
private final UnpinAllGeneralForumTopicMessages method; | ||
|
||
public UnpinAllGeneralForumTopicMessagesMethod() { | ||
this(new UnpinAllGeneralForumTopicMessages()); | ||
} | ||
|
||
public UnpinAllGeneralForumTopicMessagesMethod(@NotNull UnpinAllGeneralForumTopicMessages method) { | ||
this.method = method; | ||
} | ||
|
||
@Override | ||
public String getChatId() { | ||
return method.getChatId(); | ||
} | ||
|
||
@Override | ||
public UnpinAllGeneralForumTopicMessagesMethod setChatId(@NotNull String chatId) { | ||
method.setChatId(chatId); | ||
return this; | ||
} | ||
|
||
@Override | ||
public Boolean call(@NotNull CommonAbsSender sender) { | ||
return sender.call(method); | ||
} | ||
|
||
@Override | ||
public void callAsync(@NotNull CommonAbsSender sender, | ||
@Nullable Consumer<? super Boolean> responseConsumer, | ||
@Nullable Consumer<TelegramApiException> apiExceptionConsumer, | ||
@Nullable Consumer<Exception> exceptionConsumer) { | ||
sender.callAsync(method, responseConsumer, apiExceptionConsumer, exceptionConsumer); | ||
} | ||
} |
45 changes: 45 additions & 0 deletions
45
module/src/main/java/com/annimon/tgbotsmodule/api/methods/info/GetMyDescriptionMethod.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,45 @@ | ||
package com.annimon.tgbotsmodule.api.methods.info; | ||
|
||
import com.annimon.tgbotsmodule.api.methods.interfaces.Method; | ||
import com.annimon.tgbotsmodule.services.CommonAbsSender; | ||
import java.util.function.Consumer; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.telegram.telegrambots.meta.api.methods.description.GetMyDescription; | ||
import org.telegram.telegrambots.meta.api.objects.description.BotDescription; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class GetMyDescriptionMethod implements Method<BotDescription> { | ||
|
||
private final GetMyDescription method; | ||
|
||
public GetMyDescriptionMethod() { | ||
this(new GetMyDescription()); | ||
} | ||
|
||
public GetMyDescriptionMethod(@NotNull GetMyDescription method) { | ||
this.method = method; | ||
} | ||
|
||
public String getLanguageCode() { | ||
return method.getLanguageCode(); | ||
} | ||
|
||
public GetMyDescriptionMethod setLanguageCode(@NotNull String languageCode) { | ||
method.setLanguageCode(languageCode); | ||
return this; | ||
} | ||
|
||
@Override | ||
public BotDescription call(@NotNull CommonAbsSender sender) { | ||
return sender.call(method); | ||
} | ||
|
||
@Override | ||
public void callAsync(@NotNull CommonAbsSender sender, | ||
@Nullable Consumer<? super BotDescription> responseConsumer, | ||
@Nullable Consumer<TelegramApiException> apiExceptionConsumer, | ||
@Nullable Consumer<Exception> exceptionConsumer) { | ||
sender.callAsync(method, responseConsumer, apiExceptionConsumer, exceptionConsumer); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
module/src/main/java/com/annimon/tgbotsmodule/api/methods/info/GetMyNameMethod.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,50 @@ | ||
package com.annimon.tgbotsmodule.api.methods.info; | ||
|
||
import com.annimon.tgbotsmodule.api.methods.interfaces.Method; | ||
import com.annimon.tgbotsmodule.services.CommonAbsSender; | ||
import java.util.function.Consumer; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.telegram.telegrambots.meta.api.methods.name.GetMyName; | ||
import org.telegram.telegrambots.meta.api.objects.name.BotName; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class GetMyNameMethod implements Method<BotName> { | ||
|
||
private final GetMyName method; | ||
|
||
public GetMyNameMethod() { | ||
this(new GetMyName() { | ||
@Override | ||
public String getMethod() { | ||
return "getMyName"; // TODO: remove when will be fixed in telegrambots | ||
} | ||
}); | ||
} | ||
|
||
public GetMyNameMethod(@NotNull GetMyName method) { | ||
this.method = method; | ||
} | ||
|
||
public String getLanguageCode() { | ||
return method.getLanguageCode(); | ||
} | ||
|
||
public GetMyNameMethod setLanguageCode(@NotNull String languageCode) { | ||
method.setLanguageCode(languageCode); | ||
return this; | ||
} | ||
|
||
@Override | ||
public BotName call(@NotNull CommonAbsSender sender) { | ||
return sender.call(method); | ||
} | ||
|
||
@Override | ||
public void callAsync(@NotNull CommonAbsSender sender, | ||
@Nullable Consumer<? super BotName> responseConsumer, | ||
@Nullable Consumer<TelegramApiException> apiExceptionConsumer, | ||
@Nullable Consumer<Exception> exceptionConsumer) { | ||
sender.callAsync(method, responseConsumer, apiExceptionConsumer, exceptionConsumer); | ||
} | ||
} |
Oops, something went wrong.