mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-25 07:36:25 +00:00
Compare commits
9 Commits
f47b3673a7
...
eff2f2ba41
| Author | SHA1 | Date | |
|---|---|---|---|
| eff2f2ba41 | |||
| db644c93ff | |||
| 28e031265c | |||
| 84abd006ad | |||
| 5f4a327c2e | |||
| c5102590cc | |||
| 072264faad | |||
| 6b74bc155e | |||
| 9d506b11a3 |
@@ -2065,25 +2065,25 @@ public final class dev/inmo/tgbotapi/extensions/api/send/polls/SendPollKt {
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/stickers/AddStickerToSetKt {
|
||||
public static final fun addStickerToSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-4iNBclM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-4iNBclM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-It0iktY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-VjR9mJc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-VjR9mJc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet-VjR9mJc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet-VjR9mJc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-W2FzMBY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun addStickerToSet-W2FzMBY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet-W2FzMBY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun addStickerToSet-W2FzMBY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/stickers/CreateNewStickerSetKt {
|
||||
public static final fun createNewStickerSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun createNewStickerSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun createNewStickerSet-W2FzMBY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun createNewStickerSet-W2FzMBY$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun createNewStickerSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun createNewStickerSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ljava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun createNewStickerSet-VjR9mJc (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun createNewStickerSet-VjR9mJc$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ljava/lang/String;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerFromSetKt {
|
||||
@@ -2097,6 +2097,21 @@ public final class dev/inmo/tgbotapi/extensions/api/stickers/DeleteStickerSetKt
|
||||
public static final fun deleteStickerSet-ES61iX4 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/stickers/ReplaceStickerInSetKt {
|
||||
public static final fun replaceStickerInSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun replaceStickerInSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun replaceStickerInSet$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet-GSYghJ8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet-GSYghJ8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static synthetic fun replaceStickerInSet-GSYghJ8$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ldev/inmo/tgbotapi/types/stickers/MaskPosition;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static synthetic fun replaceStickerInSet-GSYghJ8$default (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/abstracts/InputFile;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;Ljava/util/List;Lkotlin/coroutines/Continuation;ILjava/lang/Object;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet-ftAj2Hw (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun replaceStickerInSet-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ldev/inmo/tgbotapi/requests/stickers/InputSticker;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/stickers/SetStickerEmojiListKt {
|
||||
public static final fun setStickerEmojiList (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Ljava/util/List;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerEmojiList (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/files/Sticker;[Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
@@ -2132,15 +2147,15 @@ public final class dev/inmo/tgbotapi/extensions/api/thumbs/SetCustomEmojiSticker
|
||||
public static final fun setCustomEmojiStickerSetThumbnail-KofBPHw (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ljava/lang/String;Ljava/lang/String;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/thumbs/SetStickerSetThumbKt {
|
||||
public static final fun setStickerSetThumbnail (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-4iNBclM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-4iNBclM (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-DXF-zCU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-DXF-zCU (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-It0iktY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-It0iktY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public final class dev/inmo/tgbotapi/extensions/api/thumbs/SetStickerSetThumbnailKt {
|
||||
public static final fun setStickerSetThumbnail (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ldev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-0VZ_ni8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-0VZ_ni8 (Ldev/inmo/tgbotapi/bot/RequestsExecutor;Ldev/inmo/tgbotapi/types/chat/CommonUser;Ljava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-ftAj2Hw (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-ftAj2Hw (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/FileId;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
public static final fun setStickerSetThumbnail-ySMgKnk (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLdev/inmo/tgbotapi/types/stickers/StickerSet;Ldev/inmo/tgbotapi/types/StickerFormat;Ldev/inmo/tgbotapi/requests/abstracts/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||
}
|
||||
|
||||
public final class dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandlingKt {
|
||||
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
@@ -39,6 +40,7 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = addStickerToSet(
|
||||
@@ -47,15 +49,18 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
@@ -67,6 +72,7 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = addStickerToSet(
|
||||
@@ -75,16 +81,19 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
@@ -106,18 +115,20 @@ suspend fun TelegramBot.addStickerToSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = addStickerToSet(
|
||||
user.id, stickerSet, sticker, emojis, keywords
|
||||
user.id, stickerSet, sticker, format, emojis, keywords
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.addStickerToSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = addStickerToSet(
|
||||
user.id, stickerSet, sticker, emojis, maskPosition
|
||||
user.id, stickerSet, sticker, format, emojis, maskPosition
|
||||
)
|
||||
|
||||
@@ -11,11 +11,10 @@ suspend fun TelegramBot.createNewStickerSet(
|
||||
userId: UserId,
|
||||
name: String,
|
||||
title: String,
|
||||
stickersFormat: StickerFormat,
|
||||
stickers: List<InputSticker>,
|
||||
needsRepainting: Boolean = false
|
||||
) = execute(
|
||||
CreateNewStickerSet(userId, name, title, stickersFormat, stickers, needsRepainting)
|
||||
CreateNewStickerSet(userId, name, title, stickers, needsRepainting)
|
||||
)
|
||||
|
||||
|
||||
@@ -23,9 +22,8 @@ suspend fun TelegramBot.createNewStickerSet(
|
||||
user: CommonUser,
|
||||
name: String,
|
||||
title: String,
|
||||
stickersFormat: StickerFormat,
|
||||
stickers: List<InputSticker>,
|
||||
needsRepainting: Boolean = false,
|
||||
) = createNewStickerSet(
|
||||
user.id, name, title, stickersFormat, stickers, needsRepainting
|
||||
user.id, name, title, stickers, needsRepainting
|
||||
)
|
||||
|
||||
@@ -0,0 +1,148 @@
|
||||
package dev.inmo.tgbotapi.extensions.api.stickers
|
||||
|
||||
import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.requests.stickers.ReplaceStickerInSet
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = execute(
|
||||
ReplaceStickerInSet(userId, stickerSetName, oldSticker, newSticker)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = replaceStickerInSet(userId, StickerSetName(stickerSetName), oldSticker, newSticker)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = replaceStickerInSet(
|
||||
userId,
|
||||
stickerSet.name,
|
||||
oldSticker,
|
||||
newSticker
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = replaceStickerInSet(
|
||||
userId,
|
||||
stickerSet,
|
||||
oldSticker,
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
keywords
|
||||
)
|
||||
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
|
||||
}
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = replaceStickerInSet(
|
||||
userId,
|
||||
stickerSet.name,
|
||||
oldSticker,
|
||||
when (stickerSet.stickerType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
sticker,
|
||||
format,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
is StickerType.Unknown -> error("Unable to create sticker to the set with type ${stickerSet.stickerType}")
|
||||
}
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
) = replaceStickerInSet(
|
||||
user.id,
|
||||
stickerSet.name,
|
||||
oldSticker,
|
||||
newSticker
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
keywords: List<String> = emptyList()
|
||||
) = replaceStickerInSet(
|
||||
user.id, stickerSet, oldSticker, sticker, format, emojis, keywords
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.replaceStickerInSet(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
oldSticker: FileId,
|
||||
sticker: InputFile,
|
||||
format: StickerFormat,
|
||||
emojis: List<String>,
|
||||
maskPosition: MaskPosition? = null
|
||||
) = replaceStickerInSet(
|
||||
user.id, stickerSet, oldSticker, sticker, format, emojis, maskPosition
|
||||
)
|
||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
|
||||
import dev.inmo.tgbotapi.types.StickerFormat
|
||||
import dev.inmo.tgbotapi.types.StickerSetName
|
||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
@@ -12,63 +13,71 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = execute(
|
||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
||||
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = execute(
|
||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
||||
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSetName, thumbnail
|
||||
user.id, stickerSetName, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSetName, thumbnail
|
||||
user.id, stickerSetName, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = setStickerSetThumbnail(
|
||||
userId, stickerSet.name, thumbnail
|
||||
userId, stickerSet.name, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = setStickerSetThumbnail(
|
||||
userId, stickerSet.name, thumbnail
|
||||
userId, stickerSet.name, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: FileId
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSet, thumbnail
|
||||
user.id, stickerSet, format, thumbnail
|
||||
)
|
||||
|
||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||
user: CommonUser,
|
||||
stickerSet: StickerSet,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
) = setStickerSetThumbnail(
|
||||
user.id, stickerSet, thumbnail
|
||||
user.id, stickerSet, format, thumbnail
|
||||
)
|
||||
File diff suppressed because it is too large
Load Diff
@@ -38,7 +38,7 @@ data class AddStickerToSetData internal constructor(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(stickerField)
|
||||
override val inputSticker: InputSticker
|
||||
override val newSticker: InputSticker
|
||||
) : StandardStickerSetAction {
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
|
||||
@@ -21,14 +21,13 @@ fun CreateNewStickerSet(
|
||||
userId: UserId,
|
||||
name: StickerSetName,
|
||||
title: String,
|
||||
stickersFormat: StickerFormat,
|
||||
stickers: List<InputSticker>,
|
||||
needsRepainting: Boolean? = null
|
||||
): Request<Boolean> {
|
||||
val data = when(stickers.first()) {
|
||||
is InputSticker.Mask -> CreateNewStickerSet.Mask(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.Mask>())
|
||||
is InputSticker.WithKeywords.CustomEmoji -> CreateNewStickerSet.CustomEmoji(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), needsRepainting)
|
||||
is InputSticker.WithKeywords.Regular -> CreateNewStickerSet.Regular(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.WithKeywords.Regular>())
|
||||
is InputSticker.Mask -> CreateNewStickerSet.Mask(userId, name, title, stickers.filterIsInstance<InputSticker.Mask>())
|
||||
is InputSticker.WithKeywords.CustomEmoji -> CreateNewStickerSet.CustomEmoji(userId, name, title, stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), needsRepainting)
|
||||
is InputSticker.WithKeywords.Regular -> CreateNewStickerSet.Regular(userId, name, title, stickers.filterIsInstance<InputSticker.WithKeywords.Regular>())
|
||||
}
|
||||
val multipartParts = stickers.mapNotNull {
|
||||
(it.sticker as? MultipartFile)
|
||||
@@ -63,14 +62,12 @@ fun CreateNewStickerSet(
|
||||
userId: UserId,
|
||||
name: String,
|
||||
title: String,
|
||||
stickersFormat: StickerFormat,
|
||||
stickers: List<InputSticker>,
|
||||
needsRepainting: Boolean? = null
|
||||
) = CreateNewStickerSet(
|
||||
userId = userId,
|
||||
name = StickerSetName(name),
|
||||
title = title,
|
||||
stickersFormat = stickersFormat,
|
||||
stickers = stickers,
|
||||
needsRepainting = needsRepainting
|
||||
)
|
||||
@@ -79,7 +76,6 @@ fun CreateNewStickerSet(
|
||||
sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
||||
val stickerType: StickerType
|
||||
val stickers: List<InputSticker>
|
||||
val stickersFormat: StickerFormat
|
||||
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
@@ -94,8 +90,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickerFormatField)
|
||||
override val stickersFormat: StickerFormat,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<InputSticker.WithKeywords.Regular>
|
||||
) : CreateNewStickerSet {
|
||||
@@ -111,8 +105,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickerFormatField)
|
||||
override val stickersFormat: StickerFormat,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<InputSticker.Mask>
|
||||
) : CreateNewStickerSet {
|
||||
@@ -128,8 +120,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickerFormatField)
|
||||
override val stickersFormat: StickerFormat,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<InputSticker.WithKeywords.CustomEmoji>,
|
||||
@SerialName(needsRepaintingField)
|
||||
@@ -148,8 +138,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickerFormatField)
|
||||
val stickersFormat: StickerFormat,
|
||||
@SerialName(stickersField)
|
||||
val stickers: List<InputSticker>,
|
||||
@SerialName(stickerTypeField)
|
||||
@@ -172,7 +160,6 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
|
||||
it.userId,
|
||||
it.name,
|
||||
it.title,
|
||||
it.stickersFormat,
|
||||
it.stickers,
|
||||
it.stickerType,
|
||||
(it as? CreateNewStickerSet.CustomEmoji)?.needsRepainting
|
||||
@@ -184,7 +171,6 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
|
||||
it.userId,
|
||||
it.name,
|
||||
it.title,
|
||||
it.stickersFormat,
|
||||
it.stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(),
|
||||
it.needsRepainting
|
||||
)
|
||||
@@ -192,14 +178,12 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
|
||||
it.userId,
|
||||
it.name,
|
||||
it.title,
|
||||
it.stickersFormat,
|
||||
it.stickers.filterIsInstance<InputSticker.Mask>(),
|
||||
)
|
||||
StickerType.Regular -> CreateNewStickerSet.Regular(
|
||||
it.userId,
|
||||
it.name,
|
||||
it.title,
|
||||
it.stickersFormat,
|
||||
it.stickers.filterIsInstance<InputSticker.WithKeywords.Regular>(),
|
||||
)
|
||||
is StickerType.Unknown -> error("Unable to create new sticker set due to error in type format: ${it.stickerType}")
|
||||
|
||||
@@ -2,11 +2,7 @@ package dev.inmo.tgbotapi.requests.stickers
|
||||
|
||||
import dev.inmo.micro_utils.serialization.mapper.MapperSerializer
|
||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||
import dev.inmo.tgbotapi.types.StickerType
|
||||
import dev.inmo.tgbotapi.types.emojiListField
|
||||
import dev.inmo.tgbotapi.types.keywordsField
|
||||
import dev.inmo.tgbotapi.types.maskPositionField
|
||||
import dev.inmo.tgbotapi.types.stickerField
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||
import kotlinx.serialization.KSerializer
|
||||
@@ -17,12 +13,15 @@ import kotlinx.serialization.Serializable
|
||||
@Serializable(InputStickerSerializer::class)
|
||||
sealed interface InputSticker {
|
||||
val sticker: InputFile
|
||||
val format: StickerFormat
|
||||
val emojisList: List<String>
|
||||
|
||||
@Serializable
|
||||
data class Mask(
|
||||
@SerialName(stickerField)
|
||||
override val sticker: InputFile,
|
||||
@SerialName(formatField)
|
||||
override val format: StickerFormat,
|
||||
@SerialName(emojiListField)
|
||||
override val emojisList: List<String>,
|
||||
@SerialName(maskPositionField)
|
||||
@@ -37,6 +36,8 @@ sealed interface InputSticker {
|
||||
data class Regular(
|
||||
@SerialName(stickerField)
|
||||
override val sticker: InputFile,
|
||||
@SerialName(formatField)
|
||||
override val format: StickerFormat,
|
||||
@SerialName(emojiListField)
|
||||
override val emojisList: List<String>,
|
||||
@SerialName(keywordsField)
|
||||
@@ -47,6 +48,8 @@ sealed interface InputSticker {
|
||||
data class CustomEmoji(
|
||||
@SerialName(stickerField)
|
||||
override val sticker: InputFile,
|
||||
@SerialName(formatField)
|
||||
override val format: StickerFormat,
|
||||
@SerialName(emojiListField)
|
||||
override val emojisList: List<String>,
|
||||
@SerialName(keywordsField)
|
||||
@@ -61,6 +64,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
||||
when (it) {
|
||||
is InputSticker.Mask -> SurrogateInputSticker(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
emptyList(),
|
||||
it.maskPosition,
|
||||
@@ -68,6 +72,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
||||
)
|
||||
is InputSticker.WithKeywords.CustomEmoji -> SurrogateInputSticker(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
it.keywords,
|
||||
null,
|
||||
@@ -75,6 +80,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
||||
)
|
||||
is InputSticker.WithKeywords.Regular -> SurrogateInputSticker(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
it.keywords,
|
||||
null,
|
||||
@@ -86,21 +92,25 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
||||
when (it.internalType) {
|
||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
it.keywords
|
||||
)
|
||||
StickerType.Mask -> InputSticker.Mask(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
it.maskPosition
|
||||
)
|
||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
it.keywords
|
||||
)
|
||||
is StickerType.Unknown -> InputSticker.WithKeywords.Regular(
|
||||
it.sticker,
|
||||
it.format,
|
||||
it.emojisList,
|
||||
it.keywords
|
||||
)
|
||||
@@ -111,6 +121,8 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
||||
data class SurrogateInputSticker internal constructor(
|
||||
@SerialName(stickerField)
|
||||
val sticker: InputFile,
|
||||
@SerialName(formatField)
|
||||
val format: StickerFormat,
|
||||
@SerialName(emojiListField)
|
||||
val emojisList: List<String>,
|
||||
@SerialName(keywordsField)
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
package dev.inmo.tgbotapi.requests.stickers
|
||||
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.common.CommonMultipartFileRequest
|
||||
import dev.inmo.tgbotapi.requests.stickers.abstracts.StandardStickerSetAction
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.files.File
|
||||
import kotlinx.serialization.*
|
||||
|
||||
fun ReplaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
): Request<Boolean> {
|
||||
val data = ReplaceStickerInSetData(
|
||||
userId = userId,
|
||||
name = stickerSetName,
|
||||
oldSticker = oldSticker,
|
||||
newSticker = newSticker
|
||||
)
|
||||
return when (val sticker = newSticker.sticker) {
|
||||
is MultipartFile -> CommonMultipartFileRequest(
|
||||
data,
|
||||
mapOf(sticker.fileId to sticker)
|
||||
)
|
||||
is FileId -> data
|
||||
}
|
||||
}
|
||||
|
||||
fun ReplaceStickerInSet(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
oldSticker: FileId,
|
||||
newSticker: InputSticker
|
||||
): Request<Boolean> = ReplaceStickerInSetData(
|
||||
userId = userId,
|
||||
name = StickerSetName(stickerSetName),
|
||||
oldSticker = oldSticker,
|
||||
newSticker = newSticker
|
||||
)
|
||||
|
||||
@Serializable
|
||||
data class ReplaceStickerInSetData internal constructor(
|
||||
@SerialName(userIdField)
|
||||
override val userId: UserId,
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(oldStickerField)
|
||||
val oldSticker: FileId,
|
||||
@SerialName(stickerField)
|
||||
override val newSticker: InputSticker
|
||||
) : StandardStickerSetAction {
|
||||
override fun method(): String = "replaceStickerInSet"
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
}
|
||||
@@ -9,10 +9,11 @@ import kotlinx.serialization.*
|
||||
fun SetStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSetName: StickerSetName,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
): Request<Boolean> {
|
||||
return CommonMultipartFileRequest(
|
||||
SetStickerSetThumbnail(userId, stickerSetName),
|
||||
SetStickerSetThumbnail(userId, stickerSetName, format),
|
||||
mapOf(thumbnailField to thumbnail)
|
||||
)
|
||||
}
|
||||
@@ -20,10 +21,12 @@ fun SetStickerSetThumbnail(
|
||||
fun SetStickerSetThumbnail(
|
||||
userId: UserId,
|
||||
stickerSetName: String,
|
||||
format: StickerFormat,
|
||||
thumbnail: MultipartFile
|
||||
): Request<Boolean> = SetStickerSetThumbnail(
|
||||
userId = userId,
|
||||
stickerSetName = StickerSetName(stickerSetName),
|
||||
stickerSetName = StickerSetName(stickerSetName, ),
|
||||
format = format,
|
||||
thumbnail = thumbnail
|
||||
)
|
||||
|
||||
@@ -33,6 +36,8 @@ data class SetStickerSetThumbnail (
|
||||
override val userId: UserId,
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(formatField)
|
||||
val format: StickerFormat,
|
||||
@SerialName(thumbnailField)
|
||||
val thumbnail: FileId? = null
|
||||
) : OwnerStickerSetAction {
|
||||
|
||||
@@ -1,8 +1,7 @@
|
||||
package dev.inmo.tgbotapi.requests.stickers.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||
|
||||
interface StandardStickerSetAction : OwnerStickerSetAction {
|
||||
val inputSticker: InputSticker
|
||||
val newSticker: InputSticker
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
package dev.inmo.tgbotapi.types
|
||||
|
||||
import korlibs.time.Date
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class Birthdate(
|
||||
@SerialName(dayField)
|
||||
val day: Int,
|
||||
@SerialName(monthField)
|
||||
val month: Int,
|
||||
@SerialName(yearField)
|
||||
val year: Int
|
||||
) {
|
||||
val date: Date by lazy {
|
||||
Date(year, month, day)
|
||||
}
|
||||
}
|
||||
@@ -151,6 +151,7 @@ const val profileAccentColorIdField = "profile_accent_color_id"
|
||||
const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
|
||||
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
|
||||
const val personalChatField = "personal_chat"
|
||||
const val birthdateField = "birthdate"
|
||||
const val hasVisibleHistoryField = "has_visible_history"
|
||||
const val unrestrictBoostsCountField = "unrestrict_boost_count"
|
||||
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
|
||||
@@ -263,6 +264,10 @@ const val requestUserField = "request_user"
|
||||
const val requestUsersField = "request_users"
|
||||
const val requestChatField = "request_chat"
|
||||
const val requestIdField = "request_id"
|
||||
const val requestTitleField = "request_title"
|
||||
const val requestUsernameField = "request_username"
|
||||
const val requestPhotoField = "request_photo"
|
||||
const val requestNameField = "request_name"
|
||||
const val maxQuantityField = "max_quantity"
|
||||
|
||||
const val userIsBotField = "user_is_bot"
|
||||
@@ -374,6 +379,7 @@ const val oldChatMemberField = "old_chat_member"
|
||||
const val newChatMemberField = "new_chat_member"
|
||||
const val stickerTypeField = "sticker_type"
|
||||
const val stickerFormatField = "sticker_format"
|
||||
const val formatField = "format"
|
||||
const val needsRepaintingField = "needs_repainting"
|
||||
|
||||
const val okField = "ok"
|
||||
@@ -419,6 +425,7 @@ const val offsetField = "offset"
|
||||
const val limitField = "limit"
|
||||
const val stickersField = "stickers"
|
||||
const val stickerField = "sticker"
|
||||
const val oldStickerField = "old_sticker"
|
||||
const val keywordsField = "keywords"
|
||||
const val urlField = "url"
|
||||
const val addressField = "address"
|
||||
@@ -592,3 +599,7 @@ const val businessConnectionIdField = "business_connection_id"
|
||||
const val businessIntroField = "business_intro"
|
||||
const val businessLocationField = "business_location"
|
||||
const val businessOpeningHoursField = "business_opening_hours"
|
||||
|
||||
const val dayField = "day"
|
||||
const val monthField = "month"
|
||||
const val yearField = "year"
|
||||
|
||||
@@ -19,6 +19,9 @@ const val UPDATE_MESSAGE_REACTION_COUNT = "message_reaction_count"
|
||||
const val UPDATE_CHAT_BOOST = "chat_boost"
|
||||
const val UPDATE_REMOVE_CHAT_BOOST = "removed_chat_boost"
|
||||
const val UPDATE_BUSINESS_CONNECTION = "business_connection"
|
||||
const val UPDATE_BUSINESS_MESSAGE = "business_message"
|
||||
const val UPDATE_EDITED_BUSINESS_MESSAGE = "edited_business_message"
|
||||
const val UPDATE_DELETED_BUSINESS_MESSAGES = "deleted_business_messages"
|
||||
|
||||
val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_MESSAGE,
|
||||
@@ -37,7 +40,10 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||
UPDATE_CHAT_JOIN_REQUEST,
|
||||
UPDATE_CHAT_BOOST,
|
||||
UPDATE_REMOVE_CHAT_BOOST,
|
||||
UPDATE_BUSINESS_CONNECTION
|
||||
UPDATE_BUSINESS_CONNECTION,
|
||||
UPDATE_BUSINESS_MESSAGE,
|
||||
UPDATE_EDITED_BUSINESS_MESSAGE,
|
||||
UPDATE_DELETED_BUSINESS_MESSAGES
|
||||
)
|
||||
|
||||
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(
|
||||
|
||||
@@ -1,15 +1,8 @@
|
||||
package dev.inmo.tgbotapi.types.buttons
|
||||
|
||||
import dev.inmo.tgbotapi.types.botAdministratorRightsField
|
||||
import dev.inmo.tgbotapi.types.botIsMemberField
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||
import dev.inmo.tgbotapi.types.chatHasUsernameField
|
||||
import dev.inmo.tgbotapi.types.chatIsChannelField
|
||||
import dev.inmo.tgbotapi.types.chatIsCreatedField
|
||||
import dev.inmo.tgbotapi.types.chatIsForumField
|
||||
import dev.inmo.tgbotapi.types.request.RequestId
|
||||
import dev.inmo.tgbotapi.types.requestIdField
|
||||
import dev.inmo.tgbotapi.types.userAdministratorRightsField
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -34,7 +27,13 @@ data class KeyboardButtonRequestChat(
|
||||
@SerialName(botAdministratorRightsField)
|
||||
val botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||
@SerialName(botIsMemberField)
|
||||
val botIsMember: Boolean? = null
|
||||
val botIsMember: Boolean? = null,
|
||||
@SerialName(requestTitleField)
|
||||
val requestTitle: Boolean? = null,
|
||||
@SerialName(requestUsernameField)
|
||||
val requestUsername: Boolean? = null,
|
||||
@SerialName(requestPhotoField)
|
||||
val requestPhoto: Boolean? = null
|
||||
) {
|
||||
companion object {
|
||||
fun Channel(
|
||||
|
||||
@@ -19,6 +19,9 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
val isBot: Boolean?
|
||||
val isPremium: Boolean?
|
||||
val maxCount: Int
|
||||
val requestName: Boolean?
|
||||
val requestUsername: Boolean?
|
||||
val requestPhoto: Boolean?
|
||||
|
||||
@Serializable
|
||||
data class Any(
|
||||
@@ -27,7 +30,13 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
@SerialName(userIsPremiumField)
|
||||
override val isPremium: Boolean? = null,
|
||||
@SerialName(maxQuantityField)
|
||||
override val maxCount: Int = keyboardButtonRequestUserLimit.first
|
||||
override val maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||
@SerialName(requestNameField)
|
||||
override val requestName: Boolean? = null,
|
||||
@SerialName(requestUsernameField)
|
||||
override val requestUsername: Boolean? = null,
|
||||
@SerialName(requestPhotoField)
|
||||
override val requestPhoto: Boolean? = null,
|
||||
) : KeyboardButtonRequestUsers {
|
||||
@SerialName(userIsBotField)
|
||||
@EncodeDefault
|
||||
@@ -41,7 +50,13 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
@SerialName(userIsPremiumField)
|
||||
override val isPremium: Boolean? = null,
|
||||
@SerialName(maxQuantityField)
|
||||
override val maxCount: Int = keyboardButtonRequestUserLimit.first
|
||||
override val maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||
@SerialName(requestNameField)
|
||||
override val requestName: Boolean? = null,
|
||||
@SerialName(requestUsernameField)
|
||||
override val requestUsername: Boolean? = null,
|
||||
@SerialName(requestPhotoField)
|
||||
override val requestPhoto: Boolean? = null,
|
||||
) : KeyboardButtonRequestUsers {
|
||||
@SerialName(userIsBotField)
|
||||
@EncodeDefault
|
||||
@@ -53,7 +68,13 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
@SerialName(requestIdField)
|
||||
override val requestId: RequestId,
|
||||
@SerialName(maxQuantityField)
|
||||
override val maxCount: Int = keyboardButtonRequestUserLimit.first
|
||||
override val maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||
@SerialName(requestNameField)
|
||||
override val requestName: Boolean? = null,
|
||||
@SerialName(requestUsernameField)
|
||||
override val requestUsername: Boolean? = null,
|
||||
@SerialName(requestPhotoField)
|
||||
override val requestPhoto: Boolean? = null,
|
||||
) : KeyboardButtonRequestUsers {
|
||||
@SerialName(userIsBotField)
|
||||
@EncodeDefault
|
||||
@@ -73,7 +94,13 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
@SerialName(userIsPremiumField)
|
||||
val userIsPremium: Boolean? = null,
|
||||
@SerialName(maxQuantityField)
|
||||
val maxCount: Int = keyboardButtonRequestUserLimit.first
|
||||
val maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||
@SerialName(requestNameField)
|
||||
val requestName: Boolean? = null,
|
||||
@SerialName(requestUsernameField)
|
||||
val requestUsername: Boolean? = null,
|
||||
@SerialName(requestPhotoField)
|
||||
val requestPhoto: Boolean? = null,
|
||||
)
|
||||
private val realSerializer = Surrogate.serializer()
|
||||
|
||||
@@ -83,9 +110,29 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
val surrogate = realSerializer.deserialize(decoder)
|
||||
|
||||
return when (surrogate.userIsBot) {
|
||||
true -> Bot(surrogate.requestId, surrogate.maxCount)
|
||||
false -> Common(surrogate.requestId, surrogate.userIsPremium, surrogate.maxCount)
|
||||
null -> Any(surrogate.requestId, surrogate.userIsPremium, surrogate.maxCount)
|
||||
true -> Bot(
|
||||
requestId = surrogate.requestId,
|
||||
maxCount = surrogate.maxCount,
|
||||
requestName = surrogate.requestName,
|
||||
requestUsername = surrogate.requestUsername,
|
||||
requestPhoto = surrogate.requestPhoto
|
||||
)
|
||||
false -> Common(
|
||||
requestId = surrogate.requestId,
|
||||
isPremium = surrogate.userIsPremium,
|
||||
maxCount = surrogate.maxCount,
|
||||
requestName = surrogate.requestName,
|
||||
requestUsername = surrogate.requestUsername,
|
||||
requestPhoto = surrogate.requestPhoto
|
||||
)
|
||||
null -> Any(
|
||||
requestId = surrogate.requestId,
|
||||
isPremium = surrogate.userIsPremium,
|
||||
maxCount = surrogate.maxCount,
|
||||
requestName = surrogate.requestName,
|
||||
requestUsername = surrogate.requestUsername,
|
||||
requestPhoto = surrogate.requestPhoto
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -93,10 +140,13 @@ sealed interface KeyboardButtonRequestUsers {
|
||||
realSerializer.serialize(
|
||||
encoder,
|
||||
Surrogate(
|
||||
value.requestId,
|
||||
value.isBot,
|
||||
(value as? Common) ?.isPremium,
|
||||
value.maxCount
|
||||
requestId = value.requestId,
|
||||
userIsBot = value.isBot,
|
||||
userIsPremium = (value as? Common) ?.isPremium,
|
||||
maxCount = value.maxCount,
|
||||
requestName = value.requestName,
|
||||
requestUsername = value.requestUsername,
|
||||
requestPhoto = value.requestPhoto
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
@@ -133,6 +133,8 @@ data class ExtendedPrivateChatImpl(
|
||||
override val businessLocation: BusinessLocation? = null,
|
||||
@SerialName(businessOpeningHoursField)
|
||||
override val businessOpeningHours: BusinessOpeningHours? = null,
|
||||
@SerialName(birthdateField)
|
||||
override val birthdate: Birthdate? = null,
|
||||
@SerialName(personalChatField)
|
||||
@Serializable(PreviewChatSerializer::class)
|
||||
override val personalChat: PreviewChannelChat? = null
|
||||
|
||||
@@ -46,6 +46,7 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex
|
||||
val businessLocation: BusinessLocation?
|
||||
val businessOpeningHours: BusinessOpeningHours?
|
||||
|
||||
val birthdate: Birthdate?
|
||||
val personalChat: PreviewChannelChat?
|
||||
|
||||
val allowCreateUserIdLink: Boolean
|
||||
|
||||
@@ -29,7 +29,7 @@ data class StickerSurrogate(
|
||||
val mask_position: MaskPosition? = null,
|
||||
val custom_emoji_id: CustomEmojiId? = null,
|
||||
val file_size: Long? = null,
|
||||
val needs_repainting: Boolean = false
|
||||
val needs_repainting: Boolean = false,
|
||||
)
|
||||
|
||||
// TODO:: Serializer
|
||||
@@ -40,9 +40,9 @@ sealed interface Sticker : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile,
|
||||
val stickerFormat: StickerFormat
|
||||
|
||||
val isAnimated
|
||||
get() = false
|
||||
get() = stickerFormat is StickerFormat.Animated
|
||||
val isVideo
|
||||
get() = false
|
||||
get() = stickerFormat is StickerFormat.Video
|
||||
val type: StickerType
|
||||
|
||||
fun asInputSticker(emojis: List<String> = emoji ?.let { listOf(it) } ?: error("Unable to create input sticker without emojis")): InputSticker
|
||||
@@ -238,6 +238,7 @@ sealed interface RegularSticker : Sticker {
|
||||
|
||||
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
|
||||
fileId,
|
||||
stickerFormat,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
@@ -339,6 +340,7 @@ sealed interface MaskSticker : Sticker {
|
||||
|
||||
override fun asInputSticker(emojis: List<String>) = InputSticker.Mask(
|
||||
fileId,
|
||||
stickerFormat,
|
||||
emojis,
|
||||
maskPosition
|
||||
)
|
||||
@@ -439,6 +441,7 @@ sealed interface CustomEmojiSticker : Sticker {
|
||||
|
||||
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.CustomEmoji(
|
||||
fileId,
|
||||
stickerFormat,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
@@ -563,6 +566,7 @@ data class UnknownSticker(
|
||||
) : Sticker {
|
||||
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
|
||||
fileId,
|
||||
stickerFormat,
|
||||
emojis,
|
||||
emptyList()
|
||||
)
|
||||
|
||||
@@ -1,10 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.request
|
||||
|
||||
import dev.inmo.tgbotapi.types.ChatId
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.UserId
|
||||
import dev.inmo.tgbotapi.types.chatIdField
|
||||
import dev.inmo.tgbotapi.types.requestIdField
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.files.Photo
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -13,5 +10,11 @@ data class ChatShared(
|
||||
@SerialName(requestIdField)
|
||||
override val requestId: RequestId,
|
||||
@SerialName(chatIdField)
|
||||
override val chatId: ChatId
|
||||
override val chatId: ChatId,
|
||||
@SerialName(titleField)
|
||||
val title: String? = null,
|
||||
@SerialName(usernameField)
|
||||
val username: Username? = null,
|
||||
@SerialName(photoField)
|
||||
val photo: Photo? = null
|
||||
) : ChatSharedRequest
|
||||
|
||||
@@ -0,0 +1,20 @@
|
||||
package dev.inmo.tgbotapi.types.request
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.files.Photo
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class SharedUser(
|
||||
@SerialName(userIdField)
|
||||
val id: UserId,
|
||||
@SerialName(firstNameField)
|
||||
val firstName: String? = null,
|
||||
@SerialName(lastNameField)
|
||||
val lastName: String? = null,
|
||||
@SerialName(usernameField)
|
||||
val username: Username? = null,
|
||||
@SerialName(photoField)
|
||||
val photo: Photo? = null,
|
||||
)
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.request
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.chat.PreviewUser
|
||||
import kotlinx.serialization.SerialName
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@@ -8,15 +9,30 @@ import kotlinx.serialization.Serializable
|
||||
data class UsersShared(
|
||||
@SerialName(requestIdField)
|
||||
override val requestId: RequestId,
|
||||
@SerialName(userIdsField)
|
||||
val userIds: List<UserId>
|
||||
@SerialName(usersField)
|
||||
val users: List<SharedUser>
|
||||
) : ChatSharedRequest {
|
||||
val userIds: List<UserId> by lazy {
|
||||
users.map { it.id }
|
||||
}
|
||||
val userId: UserId
|
||||
get() = userIds.first()
|
||||
constructor(
|
||||
requestId: RequestId,
|
||||
userId: UserId
|
||||
) : this(requestId, listOf(userId))
|
||||
user: SharedUser
|
||||
) : this(requestId, listOf(user))
|
||||
|
||||
override val chatId: ChatId
|
||||
get() = userId
|
||||
|
||||
companion object {
|
||||
operator fun invoke(
|
||||
requestId: RequestId,
|
||||
userIds: List<UserId>
|
||||
) = UsersShared(requestId, userIds.map { SharedUser(it) })
|
||||
operator fun invoke(
|
||||
requestId: RequestId,
|
||||
userId: UserId
|
||||
) = UsersShared(requestId, SharedUser(userId))
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,12 +25,7 @@ sealed interface StickerSet {
|
||||
val name: StickerSetName
|
||||
val title: String
|
||||
val stickerType: StickerType
|
||||
val stickerFormat: StickerFormat
|
||||
val stickers: List<Sticker>
|
||||
val isAnimated: Boolean
|
||||
get() = false
|
||||
val isVideo: Boolean
|
||||
get() = false
|
||||
val thumbnail: PhotoSize?
|
||||
|
||||
object Serializer : KSerializer<StickerSet> {
|
||||
@@ -42,69 +37,33 @@ sealed interface StickerSet {
|
||||
|
||||
return when (surrogate.sticker_type) {
|
||||
StickerType.CustomEmoji -> when {
|
||||
surrogate.is_animated == true -> CustomEmojiAnimatedStickerSet(
|
||||
else -> CustomEmojiStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<CustomEmojiAnimatedSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
surrogate.is_video == true -> CustomEmojiVideoStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<CustomEmojiVideoSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
else -> CustomEmojiSimpleStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<CustomEmojiSimpleSticker>(),
|
||||
surrogate.stickers.filterIsInstance<CustomEmojiSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
}
|
||||
StickerType.Mask -> when {
|
||||
surrogate.is_animated == true -> MaskAnimatedStickerSet(
|
||||
else -> MaskStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<MaskAnimatedSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
surrogate.is_video == true -> MaskVideoStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<MaskVideoSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
else -> MaskSimpleStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<MaskSimpleSticker>(),
|
||||
surrogate.stickers.filterIsInstance<MaskSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
}
|
||||
StickerType.Regular -> when {
|
||||
surrogate.is_animated == true -> RegularAnimatedStickerSet(
|
||||
else -> RegularStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<RegularAnimatedSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
surrogate.is_video == true -> RegularVideoStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<RegularVideoSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
else -> RegularSimpleStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<RegularSimpleSticker>(),
|
||||
surrogate.stickers.filterIsInstance<RegularSticker>(),
|
||||
surrogate.thumb
|
||||
)
|
||||
}
|
||||
is StickerType.Unknown -> UnknownStickerSet(
|
||||
surrogate.name,
|
||||
surrogate.title,
|
||||
surrogate.stickers.filterIsInstance<RegularSimpleSticker>(),
|
||||
surrogate.stickers.filterIsInstance<RegularSticker>(),
|
||||
surrogate.sticker_type,
|
||||
surrogate.thumb,
|
||||
json
|
||||
@@ -119,180 +78,48 @@ sealed interface StickerSet {
|
||||
}
|
||||
|
||||
@Serializable
|
||||
sealed interface AnimatedStickerSet : StickerSet {
|
||||
override val isAnimated: Boolean
|
||||
get() = true
|
||||
@SerialName(stickerFormatField)
|
||||
@EncodeDefault
|
||||
override val stickerFormat: StickerFormat
|
||||
get() = StickerFormat.Animated
|
||||
}
|
||||
@Serializable
|
||||
sealed interface VideoStickerSet : StickerSet {
|
||||
override val isVideo: Boolean
|
||||
get() = true
|
||||
@SerialName(stickerFormatField)
|
||||
@EncodeDefault
|
||||
override val stickerFormat: StickerFormat
|
||||
get() = StickerFormat.Video
|
||||
}
|
||||
@Serializable
|
||||
sealed interface RegularStickerSet : StickerSet
|
||||
@Serializable
|
||||
sealed interface MaskStickerSet : StickerSet
|
||||
@Serializable
|
||||
sealed interface CustomEmojiStickerSet : StickerSet
|
||||
|
||||
@Serializable
|
||||
data class RegularSimpleStickerSet(
|
||||
data class RegularStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<RegularSimpleSticker>,
|
||||
override val stickers: List<RegularSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : RegularStickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.Regular
|
||||
@SerialName(stickerFormatField)
|
||||
@EncodeDefault
|
||||
override val stickerFormat: StickerFormat = StickerFormat.Static
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class RegularAnimatedStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<RegularAnimatedSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : RegularStickerSet, AnimatedStickerSet {
|
||||
) : StickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.Regular
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class RegularVideoStickerSet(
|
||||
data class MaskStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<RegularVideoSticker>,
|
||||
override val stickers: List<MaskSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : RegularStickerSet, VideoStickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.Regular
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class MaskSimpleStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<MaskSimpleSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : MaskStickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.Mask
|
||||
|
||||
@SerialName(stickerFormatField)
|
||||
@EncodeDefault
|
||||
override val stickerFormat: StickerFormat = StickerFormat.Static
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class MaskAnimatedStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<MaskAnimatedSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : MaskStickerSet, AnimatedStickerSet {
|
||||
) : StickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.Mask
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class MaskVideoStickerSet(
|
||||
data class CustomEmojiStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<MaskVideoSticker>,
|
||||
override val stickers: List<CustomEmojiSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : MaskStickerSet, VideoStickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.Mask
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class CustomEmojiSimpleStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<CustomEmojiSimpleSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : CustomEmojiStickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.CustomEmoji
|
||||
|
||||
@SerialName(stickerFormatField)
|
||||
@EncodeDefault
|
||||
override val stickerFormat: StickerFormat = StickerFormat.Static
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class CustomEmojiAnimatedStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<CustomEmojiAnimatedSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : CustomEmojiStickerSet, AnimatedStickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.CustomEmoji
|
||||
}
|
||||
|
||||
@Serializable
|
||||
data class CustomEmojiVideoStickerSet(
|
||||
@SerialName(nameField)
|
||||
override val name: StickerSetName,
|
||||
@SerialName(titleField)
|
||||
override val title: String,
|
||||
@SerialName(stickersField)
|
||||
override val stickers: List<CustomEmojiVideoSticker>,
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null
|
||||
) : CustomEmojiStickerSet, VideoStickerSet {
|
||||
) : StickerSet {
|
||||
@SerialName(stickerTypeField)
|
||||
@EncodeDefault
|
||||
override val stickerType: StickerType = StickerType.CustomEmoji
|
||||
@@ -311,4 +138,4 @@ data class UnknownStickerSet(
|
||||
@SerialName(thumbnailField)
|
||||
override val thumbnail: PhotoSize? = null,
|
||||
val raw: JsonElement
|
||||
) : CustomEmojiStickerSet, VideoStickerSet
|
||||
) : StickerSet
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.webapps
|
||||
|
||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
||||
import dev.inmo.tgbotapi.webapps.biometric.BiometricManager
|
||||
import dev.inmo.tgbotapi.webapps.cloud.CloudStorage
|
||||
import dev.inmo.tgbotapi.webapps.haptic.HapticFeedback
|
||||
import dev.inmo.tgbotapi.webapps.invoice.InvoiceClosedInfo
|
||||
@@ -54,6 +55,9 @@ external class WebApp {
|
||||
@JsName("CloudStorage")
|
||||
val cloudStorage: CloudStorage
|
||||
|
||||
@JsName("BiometricManager")
|
||||
val biometricManager: BiometricManager
|
||||
|
||||
@JsName("SettingsButton")
|
||||
val settingsButton: SettingsButton
|
||||
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.inmo.tgbotapi.webapps.biometric
|
||||
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import kotlinx.serialization.json.buildJsonObject
|
||||
import kotlin.js.json
|
||||
|
||||
external interface BiometricAuthenticateParams {
|
||||
val reason: String?
|
||||
}
|
||||
|
||||
fun BiometricAuthenticateParams(
|
||||
reason: String? = null
|
||||
) = buildJsonObject {
|
||||
reason ?.let { put("reason", JsonPrimitive(it)) }
|
||||
}.unsafeCast<BiometricAuthenticateParams>()
|
||||
@@ -0,0 +1,51 @@
|
||||
package dev.inmo.tgbotapi.webapps.biometric
|
||||
|
||||
import kotlinx.coroutines.CompletableDeferred
|
||||
|
||||
external interface BiometricManager {
|
||||
val isInited: Boolean
|
||||
val isBiometricAvailable: Boolean
|
||||
val isAccessRequested: Boolean
|
||||
val isAccessGranted: Boolean
|
||||
val isBiometricTokenSaved: Boolean
|
||||
val deviceId: DeviceId?
|
||||
val biometricType: BiometricType
|
||||
|
||||
fun init(callback: (() -> Unit) = definedExternally): BiometricManager
|
||||
fun requestAccess(params: BiometricRequestAccessParams, callback: ((Boolean) -> Unit) = definedExternally): BiometricManager
|
||||
fun authenticate(params: BiometricAuthenticateParams, callback: ((Boolean, String?) -> Unit) = definedExternally): BiometricManager
|
||||
fun updateBiometricToken(token: String, callback: ((Boolean) -> Unit) = definedExternally): BiometricManager
|
||||
fun openSettings(): BiometricManager
|
||||
}
|
||||
|
||||
private suspend inline fun <T> doWithAsyncJob(
|
||||
action: (CompletableDeferred<T>) -> BiometricManager
|
||||
): T {
|
||||
val async = CompletableDeferred<T>()
|
||||
action(async)
|
||||
return async.await()
|
||||
}
|
||||
|
||||
suspend fun BiometricManager.initSuspend() = doWithAsyncJob {
|
||||
init {
|
||||
it.complete(Unit)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun BiometricManager.requestAccessSuspend(params: BiometricRequestAccessParams) = doWithAsyncJob {
|
||||
requestAccess(params) { success ->
|
||||
it.complete(success)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun BiometricManager.authenticateSuspend(params: BiometricAuthenticateParams) = doWithAsyncJob {
|
||||
authenticate(params) { _, token ->
|
||||
it.complete(token)
|
||||
}
|
||||
}
|
||||
|
||||
suspend fun BiometricManager.updateBiometricTokenSuspend(token: String) = doWithAsyncJob {
|
||||
updateBiometricToken(token) { success ->
|
||||
it.complete(success)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
package dev.inmo.tgbotapi.webapps.biometric
|
||||
|
||||
import kotlinx.serialization.json.JsonPrimitive
|
||||
import kotlinx.serialization.json.buildJsonObject
|
||||
import kotlin.js.json
|
||||
|
||||
external interface BiometricRequestAccessParams {
|
||||
val reason: String?
|
||||
}
|
||||
|
||||
fun BiometricRequestAccessParams(
|
||||
reason: String? = null
|
||||
) = buildJsonObject {
|
||||
reason ?.let { put("reason", JsonPrimitive(it)) }
|
||||
}.unsafeCast<BiometricRequestAccessParams>()
|
||||
@@ -0,0 +1,21 @@
|
||||
package dev.inmo.tgbotapi.webapps.biometric
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
value class BiometricType(
|
||||
val title: String
|
||||
) {
|
||||
val isFinger: Boolean
|
||||
get() = title == FingerTypeTitle
|
||||
val isFace: Boolean
|
||||
get() = title == FaceTypeTitle
|
||||
val isUnknown: Boolean
|
||||
get() = title == UnknownTypeTitle
|
||||
|
||||
companion object {
|
||||
const val FingerTypeTitle = "finger"
|
||||
const val FaceTypeTitle = "face"
|
||||
const val UnknownTypeTitle = "unknown"
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
package dev.inmo.tgbotapi.webapps.biometric
|
||||
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
value class DeviceId(
|
||||
val string: String
|
||||
)
|
||||
Reference in New Issue
Block a user