-
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
15 changed files
with
539 additions
and
225 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
421 changes: 233 additions & 188 deletions
421
module/src/main/java/com/annimon/tgbotsmodule/api/methods/Methods.java
Large diffs are not rendered by default.
Oops, something went wrong.
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
44 changes: 44 additions & 0 deletions
44
...e/src/main/java/com/annimon/tgbotsmodule/api/methods/stickers/DeleteStickerSetMethod.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,44 @@ | ||
package com.annimon.tgbotsmodule.api.methods.stickers; | ||
|
||
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.stickers.DeleteStickerSet; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class DeleteStickerSetMethod implements Method<Boolean> { | ||
|
||
private final DeleteStickerSet method; | ||
|
||
public DeleteStickerSetMethod() { | ||
this(new DeleteStickerSet()); | ||
} | ||
|
||
public DeleteStickerSetMethod(@NotNull DeleteStickerSet method) { | ||
this.method = method; | ||
} | ||
|
||
public String getName() { | ||
return method.getName(); | ||
} | ||
|
||
public DeleteStickerSetMethod setName(@NotNull String name) { | ||
method.setName(name); | ||
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); | ||
} | ||
} |
49 changes: 49 additions & 0 deletions
49
...rc/main/java/com/annimon/tgbotsmodule/api/methods/stickers/SetStickerEmojiListMethod.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,49 @@ | ||
package com.annimon.tgbotsmodule.api.methods.stickers; | ||
|
||
import com.annimon.tgbotsmodule.api.methods.interfaces.Method; | ||
import com.annimon.tgbotsmodule.services.CommonAbsSender; | ||
import java.util.List; | ||
import java.util.function.Consumer; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.telegram.telegrambots.meta.api.methods.stickers.SetStickerEmojiList; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class SetStickerEmojiListMethod implements Method<Boolean> { | ||
|
||
private final SetStickerEmojiList method; | ||
|
||
public SetStickerEmojiListMethod() { | ||
this(new SetStickerEmojiList()); | ||
} | ||
|
||
public SetStickerEmojiListMethod(@NotNull SetStickerEmojiList method) { | ||
this.method = method; | ||
} | ||
|
||
public List<String> getEmojiList() { | ||
return method.getEmojiList(); | ||
} | ||
|
||
public SetStickerEmojiListMethod setEmoji(@NotNull String emoji) { | ||
return setEmojiList(List.of(emoji)); | ||
} | ||
|
||
public SetStickerEmojiListMethod setEmojiList(@NotNull List<String> emojiList) { | ||
method.setEmojiList(emojiList); | ||
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); | ||
} | ||
} |
58 changes: 58 additions & 0 deletions
58
...src/main/java/com/annimon/tgbotsmodule/api/methods/stickers/SetStickerKeywordsMethod.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,58 @@ | ||
package com.annimon.tgbotsmodule.api.methods.stickers; | ||
|
||
import com.annimon.tgbotsmodule.api.methods.interfaces.Method; | ||
import com.annimon.tgbotsmodule.services.CommonAbsSender; | ||
import java.util.List; | ||
import java.util.function.Consumer; | ||
import org.jetbrains.annotations.NotNull; | ||
import org.jetbrains.annotations.Nullable; | ||
import org.telegram.telegrambots.meta.api.methods.stickers.SetStickerKeywords; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class SetStickerKeywordsMethod implements Method<Boolean> { | ||
|
||
private final SetStickerKeywords method; | ||
|
||
public SetStickerKeywordsMethod() { | ||
this(new SetStickerKeywords()); | ||
} | ||
|
||
public SetStickerKeywordsMethod(@NotNull SetStickerKeywords method) { | ||
this.method = method; | ||
} | ||
|
||
public String getSticker() { | ||
return method.getSticker(); | ||
} | ||
|
||
public SetStickerKeywordsMethod setSticker(@NotNull String sticker) { | ||
method.setSticker(sticker); | ||
return this; | ||
} | ||
|
||
public List<String> getKeywords() { | ||
return method.getKeywords(); | ||
} | ||
|
||
public SetStickerKeywordsMethod setKeyword(@NotNull String keyword) { | ||
return setKeywords(List.of(keyword)); | ||
} | ||
|
||
public SetStickerKeywordsMethod setKeywords(@NotNull List<String> keywords) { | ||
method.setKeywords(keywords); | ||
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); | ||
} | ||
} |
54 changes: 54 additions & 0 deletions
54
...main/java/com/annimon/tgbotsmodule/api/methods/stickers/SetStickerMaskPositionMethod.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,54 @@ | ||
package com.annimon.tgbotsmodule.api.methods.stickers; | ||
|
||
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.stickers.SetStickerMaskPosition; | ||
import org.telegram.telegrambots.meta.api.objects.stickers.MaskPosition; | ||
import org.telegram.telegrambots.meta.exceptions.TelegramApiException; | ||
|
||
public class SetStickerMaskPositionMethod implements Method<Boolean> { | ||
|
||
private final SetStickerMaskPosition method; | ||
|
||
public SetStickerMaskPositionMethod() { | ||
this(new SetStickerMaskPosition()); | ||
} | ||
|
||
public SetStickerMaskPositionMethod(@NotNull SetStickerMaskPosition method) { | ||
this.method = method; | ||
} | ||
|
||
public String getSticker() { | ||
return method.getSticker(); | ||
} | ||
|
||
public SetStickerMaskPositionMethod setSticker(@NotNull String sticker) { | ||
method.setSticker(sticker); | ||
return this; | ||
} | ||
|
||
public MaskPosition getMaskPosition() { | ||
return method.getMaskPosition(); | ||
} | ||
|
||
public SetStickerMaskPositionMethod setMaskPosition(@NotNull MaskPosition maskPosition) { | ||
method.setMaskPosition(maskPosition); | ||
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); | ||
} | ||
} |
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
Oops, something went wrong.