mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-12-25 23:55:48 +00:00
Compare commits
20 Commits
f47b3673a7
...
v12.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| 3da2229a9c | |||
| 624289cc8e | |||
| 9edc8a0d5a | |||
| 3bf914471a | |||
| 7d3c8a2d27 | |||
| f12628bec3 | |||
| c1734e6d12 | |||
| 4bff860c01 | |||
| 6a8b83f750 | |||
| ab9718b7c6 | |||
| 0a9235bcd9 | |||
| eff2f2ba41 | |||
| db644c93ff | |||
| 28e031265c | |||
| 84abd006ad | |||
| 5f4a327c2e | |||
| c5102590cc | |||
| 072264faad | |||
| 6b74bc155e | |||
| 9d506b11a3 |
11
CHANGELOG.md
11
CHANGELOG.md
@@ -1,7 +1,18 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 12.0.1
|
||||||
|
|
||||||
|
* `Version`:
|
||||||
|
* `Ktor`: `2.3.9` -> `2.3.10`
|
||||||
|
* `MicroUtils`: `0.20.39` -> `0.20.45`
|
||||||
|
* `UUID`: `0.8.2` -> `0.8.4`
|
||||||
|
|
||||||
## 12.0.0
|
## 12.0.0
|
||||||
|
|
||||||
|
**Add support of [Telegram Bots API 7.2](https://core.telegram.org/bots/api-changelog#march-31-2024)**
|
||||||
|
|
||||||
|
**THIS UPDATE CONTAINS A LOT OF BREAKING CHANGES**
|
||||||
|
|
||||||
## 11.0.0
|
## 11.0.0
|
||||||
|
|
||||||
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**
|
**THIS UPDATE CONTAINS REMOVES OF DEPRECATED THINGS**
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#february-16-2024)
|
# TelegramBotAPI [](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [](https://core.telegram.org/bots/api-changelog#march-31-2024)
|
||||||
|
|
||||||
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
| Docs | [](https://tgbotapi.inmo.dev/index.html) [](https://docs.inmo.dev/tgbotapi/index.html) |
|
||||||
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
|:----------------------:|:-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------:|
|
||||||
|
|||||||
@@ -6,4 +6,4 @@ kotlin.incremental=true
|
|||||||
kotlin.incremental.js=true
|
kotlin.incremental.js=true
|
||||||
|
|
||||||
library_group=dev.inmo
|
library_group=dev.inmo
|
||||||
library_version=12.0.0
|
library_version=12.0.1
|
||||||
|
|||||||
@@ -7,13 +7,13 @@ kotlin-coroutines = "1.8.0"
|
|||||||
javax-activation = "1.1.1"
|
javax-activation = "1.1.1"
|
||||||
|
|
||||||
korlibs = "5.4.0"
|
korlibs = "5.4.0"
|
||||||
uuid = "0.8.2"
|
uuid = "0.8.4"
|
||||||
ktor = "2.3.9"
|
ktor = "2.3.10"
|
||||||
|
|
||||||
ksp = "1.9.23-1.0.19"
|
ksp = "1.9.23-1.0.20"
|
||||||
kotlin-poet = "1.16.0"
|
kotlin-poet = "1.16.0"
|
||||||
|
|
||||||
microutils = "0.20.39"
|
microutils = "0.20.45"
|
||||||
kslog = "1.3.3"
|
kslog = "1.3.3"
|
||||||
|
|
||||||
versions = "0.51.0"
|
versions = "0.51.0"
|
||||||
|
|||||||
2
gradle/wrapper/gradle-wrapper.properties
vendored
2
gradle/wrapper/gradle-wrapper.properties
vendored
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
|
|||||||
distributionPath=wrapper/dists
|
distributionPath=wrapper/dists
|
||||||
zipStoreBase=GRADLE_USER_HOME
|
zipStoreBase=GRADLE_USER_HOME
|
||||||
zipStorePath=wrapper/dists
|
zipStorePath=wrapper/dists
|
||||||
distributionUrl=https\://services.gradle.org/distributions/gradle-8.6-bin.zip
|
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
|
||||||
|
|||||||
@@ -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 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;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;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;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 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;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;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;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;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-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-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-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-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 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-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-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-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 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 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 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;Ldev/inmo/tgbotapi/types/StickerFormat;Ljava/util/List;ZLkotlin/coroutines/Continuation;ILjava/lang/Object;)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-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 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-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 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 {
|
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 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 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/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;
|
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 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 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/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/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 (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-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-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-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-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-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-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-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-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-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-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-It0iktY (Ldev/inmo/tgbotapi/bot/RequestsExecutor;JLjava/lang/String;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/MultipartFile;Lkotlin/coroutines/Continuation;)Ljava/lang/Object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final class dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandlingKt {
|
public final class dev/inmo/tgbotapi/extensions/api/utils/UpdatesHandlingKt {
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
|||||||
|
|
||||||
suspend fun TelegramBot.getBusinessConnection(
|
suspend fun TelegramBot.getBusinessConnection(
|
||||||
id: BusinessConnectionId
|
id: BusinessConnectionId
|
||||||
) = execute(GetBusinessConnection(id = id))
|
) = execute(GetBusinessConnection(businessConnectionId = id))
|
||||||
|
|
||||||
@Warning("This method may lead to error due to raw String type usage")
|
@Warning("This method may lead to error due to raw String type usage")
|
||||||
suspend fun TelegramBot.getBusinessConnection(
|
suspend fun TelegramBot.getBusinessConnection(
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
|
|||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
import dev.inmo.tgbotapi.requests.stickers.AddStickerToSet
|
||||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||||
|
import dev.inmo.tgbotapi.types.StickerFormat
|
||||||
import dev.inmo.tgbotapi.types.StickerSetName
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
import dev.inmo.tgbotapi.types.StickerType
|
import dev.inmo.tgbotapi.types.StickerType
|
||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
@@ -39,6 +40,7 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
keywords: List<String> = emptyList()
|
keywords: List<String> = emptyList()
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
@@ -47,15 +49,18 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
when (stickerSet.stickerType) {
|
when (stickerSet.stickerType) {
|
||||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
keywords
|
keywords
|
||||||
)
|
)
|
||||||
StickerType.Mask -> InputSticker.Mask(
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis
|
emojis
|
||||||
)
|
)
|
||||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
keywords
|
keywords
|
||||||
)
|
)
|
||||||
@@ -67,6 +72,7 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
maskPosition: MaskPosition? = null
|
maskPosition: MaskPosition? = null
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
@@ -75,16 +81,19 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
when (stickerSet.stickerType) {
|
when (stickerSet.stickerType) {
|
||||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
StickerType.Mask -> InputSticker.Mask(
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
maskPosition
|
maskPosition
|
||||||
)
|
)
|
||||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
sticker,
|
sticker,
|
||||||
|
format,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
@@ -106,18 +115,20 @@ suspend fun TelegramBot.addStickerToSet(
|
|||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
keywords: List<String> = emptyList()
|
keywords: List<String> = emptyList()
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
user.id, stickerSet, sticker, emojis, keywords
|
user.id, stickerSet, sticker, format, emojis, keywords
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.addStickerToSet(
|
suspend fun TelegramBot.addStickerToSet(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
sticker: InputFile,
|
sticker: InputFile,
|
||||||
|
format: StickerFormat,
|
||||||
emojis: List<String>,
|
emojis: List<String>,
|
||||||
maskPosition: MaskPosition? = null
|
maskPosition: MaskPosition? = null
|
||||||
) = addStickerToSet(
|
) = addStickerToSet(
|
||||||
user.id, stickerSet, sticker, emojis, maskPosition
|
user.id, stickerSet, sticker, format, emojis, maskPosition
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,11 +11,10 @@ suspend fun TelegramBot.createNewStickerSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
name: String,
|
name: String,
|
||||||
title: String,
|
title: String,
|
||||||
stickersFormat: StickerFormat,
|
|
||||||
stickers: List<InputSticker>,
|
stickers: List<InputSticker>,
|
||||||
needsRepainting: Boolean = false
|
needsRepainting: Boolean = false
|
||||||
) = execute(
|
) = execute(
|
||||||
CreateNewStickerSet(userId, name, title, stickersFormat, stickers, needsRepainting)
|
CreateNewStickerSet(userId, name, title, stickers, needsRepainting)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -23,9 +22,8 @@ suspend fun TelegramBot.createNewStickerSet(
|
|||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
name: String,
|
name: String,
|
||||||
title: String,
|
title: String,
|
||||||
stickersFormat: StickerFormat,
|
|
||||||
stickers: List<InputSticker>,
|
stickers: List<InputSticker>,
|
||||||
needsRepainting: Boolean = false,
|
needsRepainting: Boolean = false,
|
||||||
) = createNewStickerSet(
|
) = 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.FileId
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
|
||||||
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
|
import dev.inmo.tgbotapi.requests.stickers.SetStickerSetThumbnail
|
||||||
|
import dev.inmo.tgbotapi.types.StickerFormat
|
||||||
import dev.inmo.tgbotapi.types.StickerSetName
|
import dev.inmo.tgbotapi.types.StickerSetName
|
||||||
import dev.inmo.tgbotapi.types.chat.CommonUser
|
import dev.inmo.tgbotapi.types.chat.CommonUser
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
import dev.inmo.tgbotapi.types.UserId
|
||||||
@@ -12,63 +13,71 @@ import dev.inmo.tgbotapi.types.stickers.StickerSet
|
|||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = execute(
|
) = execute(
|
||||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = execute(
|
) = execute(
|
||||||
SetStickerSetThumbnail(userId, stickerSetName, thumbnail)
|
SetStickerSetThumbnail(userId, stickerSetName, format, thumbnail)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSetName, thumbnail
|
user.id, stickerSetName, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSetName, thumbnail
|
user.id, stickerSetName, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
userId, stickerSet.name, thumbnail
|
userId, stickerSet.name, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
userId, stickerSet.name, thumbnail
|
userId, stickerSet.name, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: FileId
|
thumbnail: FileId
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSet, thumbnail
|
user.id, stickerSet, format, thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun TelegramBot.setStickerSetThumbnail(
|
suspend fun TelegramBot.setStickerSetThumbnail(
|
||||||
user: CommonUser,
|
user: CommonUser,
|
||||||
stickerSet: StickerSet,
|
stickerSet: StickerSet,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
) = setStickerSetThumbnail(
|
) = setStickerSetThumbnail(
|
||||||
user.id, stickerSet, thumbnail
|
user.id, stickerSet, format, thumbnail
|
||||||
)
|
)
|
||||||
File diff suppressed because it is too large
Load Diff
@@ -102,7 +102,7 @@ class DefaultKtorRequestsExecutor internal constructor(
|
|||||||
is BotException -> e
|
is BotException -> e
|
||||||
else -> CommonBotException(cause = e)
|
else -> CommonBotException(cause = e)
|
||||||
}.also { newException ->
|
}.also { newException ->
|
||||||
logger.v(newException) { "Result exception on handling of $request is an exception" }
|
logger.v(newException) { "Result exception on handling of $request is an exception: ${newException.stackTraceToString()}" }
|
||||||
if (newException is GetUpdatesConflict) {
|
if (newException is GetUpdatesConflict) {
|
||||||
logger.w(newException) {
|
logger.w(newException) {
|
||||||
"Warning!!! Other bot with the same bot token requests updates with getUpdate in parallel"
|
"Warning!!! Other bot with the same bot token requests updates with getUpdate in parallel"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ data class GetChat(
|
|||||||
@Transient
|
@Transient
|
||||||
override val resultDeserializer: DeserializationStrategy<ExtendedChat> = when {
|
override val resultDeserializer: DeserializationStrategy<ExtendedChat> = when {
|
||||||
chatId is ChatIdWithThreadId -> ExtendedChatSerializer.BasedOnForumThread(chatId.threadId)
|
chatId is ChatIdWithThreadId -> ExtendedChatSerializer.BasedOnForumThread(chatId.threadId)
|
||||||
chatId is BusinessChatId -> ExtendedChatSerializer.BasedOnBusinessConnection(chatId.businessId)
|
chatId is BusinessChatId -> ExtendedChatSerializer.BasedOnBusinessConnection(chatId.businessConnectionId)
|
||||||
else -> ExtendedChatSerializer.Companion
|
else -> ExtendedChatSerializer.Companion
|
||||||
}
|
}
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package dev.inmo.tgbotapi.requests.get
|
package dev.inmo.tgbotapi.requests.get
|
||||||
|
|
||||||
|
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
import dev.inmo.tgbotapi.requests.abstracts.SimpleRequest
|
||||||
|
import dev.inmo.tgbotapi.types.businessConnectionIdField
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnection
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.files.PathedFile
|
|
||||||
import dev.inmo.tgbotapi.types.idField
|
|
||||||
import kotlinx.serialization.DeserializationStrategy
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
@@ -12,15 +12,15 @@ import kotlinx.serialization.SerializationStrategy
|
|||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class GetBusinessConnection(
|
data class GetBusinessConnection(
|
||||||
@SerialName(idField)
|
@SerialName(businessConnectionIdField)
|
||||||
val id: BusinessConnectionId
|
override val businessConnectionId: BusinessConnectionId
|
||||||
) : SimpleRequest<BusinessConnection> {
|
) : SimpleRequest<BusinessConnection>, WithBusinessConnectionId {
|
||||||
override fun method(): String {
|
override fun method(): String {
|
||||||
return "getBusinessConnection"
|
return "getBusinessConnection"
|
||||||
}
|
}
|
||||||
|
|
||||||
override val resultDeserializer: DeserializationStrategy<BusinessConnection>
|
override val resultDeserializer: DeserializationStrategy<BusinessConnection>
|
||||||
get() = BusinessConnection.serializer()
|
get() = BusinessConnection.Companion
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
get() = serializer()
|
get() = serializer()
|
||||||
}
|
}
|
||||||
@@ -38,7 +38,7 @@ data class AddStickerToSetData internal constructor(
|
|||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(stickerField)
|
@SerialName(stickerField)
|
||||||
override val inputSticker: InputSticker
|
override val newSticker: InputSticker
|
||||||
) : StandardStickerSetAction {
|
) : StandardStickerSetAction {
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
get() = serializer()
|
get() = serializer()
|
||||||
|
|||||||
@@ -21,14 +21,13 @@ fun CreateNewStickerSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
name: StickerSetName,
|
name: StickerSetName,
|
||||||
title: String,
|
title: String,
|
||||||
stickersFormat: StickerFormat,
|
|
||||||
stickers: List<InputSticker>,
|
stickers: List<InputSticker>,
|
||||||
needsRepainting: Boolean? = null
|
needsRepainting: Boolean? = null
|
||||||
): Request<Boolean> {
|
): Request<Boolean> {
|
||||||
val data = when(stickers.first()) {
|
val data = when(stickers.first()) {
|
||||||
is InputSticker.Mask -> CreateNewStickerSet.Mask(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.Mask>())
|
is InputSticker.Mask -> CreateNewStickerSet.Mask(userId, name, title, stickers.filterIsInstance<InputSticker.Mask>())
|
||||||
is InputSticker.WithKeywords.CustomEmoji -> CreateNewStickerSet.CustomEmoji(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), needsRepainting)
|
is InputSticker.WithKeywords.CustomEmoji -> CreateNewStickerSet.CustomEmoji(userId, name, title, stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(), needsRepainting)
|
||||||
is InputSticker.WithKeywords.Regular -> CreateNewStickerSet.Regular(userId, name, title, stickersFormat, stickers.filterIsInstance<InputSticker.WithKeywords.Regular>())
|
is InputSticker.WithKeywords.Regular -> CreateNewStickerSet.Regular(userId, name, title, stickers.filterIsInstance<InputSticker.WithKeywords.Regular>())
|
||||||
}
|
}
|
||||||
val multipartParts = stickers.mapNotNull {
|
val multipartParts = stickers.mapNotNull {
|
||||||
(it.sticker as? MultipartFile)
|
(it.sticker as? MultipartFile)
|
||||||
@@ -63,14 +62,12 @@ fun CreateNewStickerSet(
|
|||||||
userId: UserId,
|
userId: UserId,
|
||||||
name: String,
|
name: String,
|
||||||
title: String,
|
title: String,
|
||||||
stickersFormat: StickerFormat,
|
|
||||||
stickers: List<InputSticker>,
|
stickers: List<InputSticker>,
|
||||||
needsRepainting: Boolean? = null
|
needsRepainting: Boolean? = null
|
||||||
) = CreateNewStickerSet(
|
) = CreateNewStickerSet(
|
||||||
userId = userId,
|
userId = userId,
|
||||||
name = StickerSetName(name),
|
name = StickerSetName(name),
|
||||||
title = title,
|
title = title,
|
||||||
stickersFormat = stickersFormat,
|
|
||||||
stickers = stickers,
|
stickers = stickers,
|
||||||
needsRepainting = needsRepainting
|
needsRepainting = needsRepainting
|
||||||
)
|
)
|
||||||
@@ -79,7 +76,6 @@ fun CreateNewStickerSet(
|
|||||||
sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
||||||
val stickerType: StickerType
|
val stickerType: StickerType
|
||||||
val stickers: List<InputSticker>
|
val stickers: List<InputSticker>
|
||||||
val stickersFormat: StickerFormat
|
|
||||||
|
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
get() = serializer()
|
get() = serializer()
|
||||||
@@ -94,8 +90,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
|||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickerFormatField)
|
|
||||||
override val stickersFormat: StickerFormat,
|
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<InputSticker.WithKeywords.Regular>
|
override val stickers: List<InputSticker.WithKeywords.Regular>
|
||||||
) : CreateNewStickerSet {
|
) : CreateNewStickerSet {
|
||||||
@@ -111,8 +105,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
|||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickerFormatField)
|
|
||||||
override val stickersFormat: StickerFormat,
|
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<InputSticker.Mask>
|
override val stickers: List<InputSticker.Mask>
|
||||||
) : CreateNewStickerSet {
|
) : CreateNewStickerSet {
|
||||||
@@ -128,8 +120,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
|||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickerFormatField)
|
|
||||||
override val stickersFormat: StickerFormat,
|
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<InputSticker.WithKeywords.CustomEmoji>,
|
override val stickers: List<InputSticker.WithKeywords.CustomEmoji>,
|
||||||
@SerialName(needsRepaintingField)
|
@SerialName(needsRepaintingField)
|
||||||
@@ -148,8 +138,6 @@ sealed interface CreateNewStickerSet : CreateStickerSetAction {
|
|||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickerFormatField)
|
|
||||||
val stickersFormat: StickerFormat,
|
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
val stickers: List<InputSticker>,
|
val stickers: List<InputSticker>,
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@@ -172,7 +160,6 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
|
|||||||
it.userId,
|
it.userId,
|
||||||
it.name,
|
it.name,
|
||||||
it.title,
|
it.title,
|
||||||
it.stickersFormat,
|
|
||||||
it.stickers,
|
it.stickers,
|
||||||
it.stickerType,
|
it.stickerType,
|
||||||
(it as? CreateNewStickerSet.CustomEmoji)?.needsRepainting
|
(it as? CreateNewStickerSet.CustomEmoji)?.needsRepainting
|
||||||
@@ -184,7 +171,6 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
|
|||||||
it.userId,
|
it.userId,
|
||||||
it.name,
|
it.name,
|
||||||
it.title,
|
it.title,
|
||||||
it.stickersFormat,
|
|
||||||
it.stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(),
|
it.stickers.filterIsInstance<InputSticker.WithKeywords.CustomEmoji>(),
|
||||||
it.needsRepainting
|
it.needsRepainting
|
||||||
)
|
)
|
||||||
@@ -192,14 +178,12 @@ object CreateNewStickerSetSerializer : KSerializer<CreateNewStickerSet>,
|
|||||||
it.userId,
|
it.userId,
|
||||||
it.name,
|
it.name,
|
||||||
it.title,
|
it.title,
|
||||||
it.stickersFormat,
|
|
||||||
it.stickers.filterIsInstance<InputSticker.Mask>(),
|
it.stickers.filterIsInstance<InputSticker.Mask>(),
|
||||||
)
|
)
|
||||||
StickerType.Regular -> CreateNewStickerSet.Regular(
|
StickerType.Regular -> CreateNewStickerSet.Regular(
|
||||||
it.userId,
|
it.userId,
|
||||||
it.name,
|
it.name,
|
||||||
it.title,
|
it.title,
|
||||||
it.stickersFormat,
|
|
||||||
it.stickers.filterIsInstance<InputSticker.WithKeywords.Regular>(),
|
it.stickers.filterIsInstance<InputSticker.WithKeywords.Regular>(),
|
||||||
)
|
)
|
||||||
is StickerType.Unknown -> error("Unable to create new sticker set due to error in type format: ${it.stickerType}")
|
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.micro_utils.serialization.mapper.MapperSerializer
|
||||||
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
import dev.inmo.tgbotapi.requests.abstracts.InputFile
|
||||||
import dev.inmo.tgbotapi.types.StickerType
|
import dev.inmo.tgbotapi.types.*
|
||||||
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.stickers.MaskPosition
|
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
||||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||||
import kotlinx.serialization.KSerializer
|
import kotlinx.serialization.KSerializer
|
||||||
@@ -17,12 +13,15 @@ import kotlinx.serialization.Serializable
|
|||||||
@Serializable(InputStickerSerializer::class)
|
@Serializable(InputStickerSerializer::class)
|
||||||
sealed interface InputSticker {
|
sealed interface InputSticker {
|
||||||
val sticker: InputFile
|
val sticker: InputFile
|
||||||
|
val format: StickerFormat
|
||||||
val emojisList: List<String>
|
val emojisList: List<String>
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Mask(
|
data class Mask(
|
||||||
@SerialName(stickerField)
|
@SerialName(stickerField)
|
||||||
override val sticker: InputFile,
|
override val sticker: InputFile,
|
||||||
|
@SerialName(formatField)
|
||||||
|
override val format: StickerFormat,
|
||||||
@SerialName(emojiListField)
|
@SerialName(emojiListField)
|
||||||
override val emojisList: List<String>,
|
override val emojisList: List<String>,
|
||||||
@SerialName(maskPositionField)
|
@SerialName(maskPositionField)
|
||||||
@@ -37,6 +36,8 @@ sealed interface InputSticker {
|
|||||||
data class Regular(
|
data class Regular(
|
||||||
@SerialName(stickerField)
|
@SerialName(stickerField)
|
||||||
override val sticker: InputFile,
|
override val sticker: InputFile,
|
||||||
|
@SerialName(formatField)
|
||||||
|
override val format: StickerFormat,
|
||||||
@SerialName(emojiListField)
|
@SerialName(emojiListField)
|
||||||
override val emojisList: List<String>,
|
override val emojisList: List<String>,
|
||||||
@SerialName(keywordsField)
|
@SerialName(keywordsField)
|
||||||
@@ -47,6 +48,8 @@ sealed interface InputSticker {
|
|||||||
data class CustomEmoji(
|
data class CustomEmoji(
|
||||||
@SerialName(stickerField)
|
@SerialName(stickerField)
|
||||||
override val sticker: InputFile,
|
override val sticker: InputFile,
|
||||||
|
@SerialName(formatField)
|
||||||
|
override val format: StickerFormat,
|
||||||
@SerialName(emojiListField)
|
@SerialName(emojiListField)
|
||||||
override val emojisList: List<String>,
|
override val emojisList: List<String>,
|
||||||
@SerialName(keywordsField)
|
@SerialName(keywordsField)
|
||||||
@@ -61,6 +64,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
|||||||
when (it) {
|
when (it) {
|
||||||
is InputSticker.Mask -> SurrogateInputSticker(
|
is InputSticker.Mask -> SurrogateInputSticker(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
emptyList(),
|
emptyList(),
|
||||||
it.maskPosition,
|
it.maskPosition,
|
||||||
@@ -68,6 +72,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
|||||||
)
|
)
|
||||||
is InputSticker.WithKeywords.CustomEmoji -> SurrogateInputSticker(
|
is InputSticker.WithKeywords.CustomEmoji -> SurrogateInputSticker(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
it.keywords,
|
it.keywords,
|
||||||
null,
|
null,
|
||||||
@@ -75,6 +80,7 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
|||||||
)
|
)
|
||||||
is InputSticker.WithKeywords.Regular -> SurrogateInputSticker(
|
is InputSticker.WithKeywords.Regular -> SurrogateInputSticker(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
it.keywords,
|
it.keywords,
|
||||||
null,
|
null,
|
||||||
@@ -86,21 +92,25 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
|||||||
when (it.internalType) {
|
when (it.internalType) {
|
||||||
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
StickerType.CustomEmoji -> InputSticker.WithKeywords.CustomEmoji(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
it.keywords
|
it.keywords
|
||||||
)
|
)
|
||||||
StickerType.Mask -> InputSticker.Mask(
|
StickerType.Mask -> InputSticker.Mask(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
it.maskPosition
|
it.maskPosition
|
||||||
)
|
)
|
||||||
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
StickerType.Regular -> InputSticker.WithKeywords.Regular(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
it.keywords
|
it.keywords
|
||||||
)
|
)
|
||||||
is StickerType.Unknown -> InputSticker.WithKeywords.Regular(
|
is StickerType.Unknown -> InputSticker.WithKeywords.Regular(
|
||||||
it.sticker,
|
it.sticker,
|
||||||
|
it.format,
|
||||||
it.emojisList,
|
it.emojisList,
|
||||||
it.keywords
|
it.keywords
|
||||||
)
|
)
|
||||||
@@ -111,6 +121,8 @@ object InputStickerSerializer : KSerializer<InputSticker>, MapperSerializer<Inpu
|
|||||||
data class SurrogateInputSticker internal constructor(
|
data class SurrogateInputSticker internal constructor(
|
||||||
@SerialName(stickerField)
|
@SerialName(stickerField)
|
||||||
val sticker: InputFile,
|
val sticker: InputFile,
|
||||||
|
@SerialName(formatField)
|
||||||
|
val format: StickerFormat,
|
||||||
@SerialName(emojiListField)
|
@SerialName(emojiListField)
|
||||||
val emojisList: List<String>,
|
val emojisList: List<String>,
|
||||||
@SerialName(keywordsField)
|
@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(
|
fun SetStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: StickerSetName,
|
stickerSetName: StickerSetName,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
): Request<Boolean> {
|
): Request<Boolean> {
|
||||||
return CommonMultipartFileRequest(
|
return CommonMultipartFileRequest(
|
||||||
SetStickerSetThumbnail(userId, stickerSetName),
|
SetStickerSetThumbnail(userId, stickerSetName, format),
|
||||||
mapOf(thumbnailField to thumbnail)
|
mapOf(thumbnailField to thumbnail)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
@@ -20,10 +21,12 @@ fun SetStickerSetThumbnail(
|
|||||||
fun SetStickerSetThumbnail(
|
fun SetStickerSetThumbnail(
|
||||||
userId: UserId,
|
userId: UserId,
|
||||||
stickerSetName: String,
|
stickerSetName: String,
|
||||||
|
format: StickerFormat,
|
||||||
thumbnail: MultipartFile
|
thumbnail: MultipartFile
|
||||||
): Request<Boolean> = SetStickerSetThumbnail(
|
): Request<Boolean> = SetStickerSetThumbnail(
|
||||||
userId = userId,
|
userId = userId,
|
||||||
stickerSetName = StickerSetName(stickerSetName),
|
stickerSetName = StickerSetName(stickerSetName, ),
|
||||||
|
format = format,
|
||||||
thumbnail = thumbnail
|
thumbnail = thumbnail
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -33,6 +36,8 @@ data class SetStickerSetThumbnail (
|
|||||||
override val userId: UserId,
|
override val userId: UserId,
|
||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
|
@SerialName(formatField)
|
||||||
|
val format: StickerFormat,
|
||||||
@SerialName(thumbnailField)
|
@SerialName(thumbnailField)
|
||||||
val thumbnail: FileId? = null
|
val thumbnail: FileId? = null
|
||||||
) : OwnerStickerSetAction {
|
) : OwnerStickerSetAction {
|
||||||
|
|||||||
@@ -1,8 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.requests.stickers.abstracts
|
package dev.inmo.tgbotapi.requests.stickers.abstracts
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
import dev.inmo.tgbotapi.requests.stickers.InputSticker
|
||||||
import dev.inmo.tgbotapi.types.stickers.MaskPosition
|
|
||||||
|
|
||||||
interface StandardStickerSetAction : OwnerStickerSetAction {
|
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)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -30,7 +30,7 @@ sealed interface IdChatIdentifier : ChatIdentifier {
|
|||||||
abstract val chatId: RawChatId
|
abstract val chatId: RawChatId
|
||||||
val threadId: MessageThreadId?
|
val threadId: MessageThreadId?
|
||||||
get() = null
|
get() = null
|
||||||
val businessId: BusinessConnectionId?
|
val businessConnectionId: BusinessConnectionId?
|
||||||
get() = null
|
get() = null
|
||||||
|
|
||||||
companion object {
|
companion object {
|
||||||
@@ -63,7 +63,7 @@ value class ChatIdWithThreadId(val chatIdWithThreadId: Pair<RawChatId, MessageTh
|
|||||||
value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, BusinessConnectionId>) : IdChatIdentifier {
|
value class BusinessChatId(val chatIdWithBusinessConnectionId: Pair<RawChatId, BusinessConnectionId>) : IdChatIdentifier {
|
||||||
override val chatId: RawChatId
|
override val chatId: RawChatId
|
||||||
get() = chatIdWithBusinessConnectionId.first
|
get() = chatIdWithBusinessConnectionId.first
|
||||||
override val businessId: BusinessConnectionId
|
override val businessConnectionId: BusinessConnectionId
|
||||||
get() = chatIdWithBusinessConnectionId.second
|
get() = chatIdWithBusinessConnectionId.second
|
||||||
|
|
||||||
constructor(chatId: RawChatId, businessConnectionId: BusinessConnectionId): this(chatId to businessConnectionId)
|
constructor(chatId: RawChatId, businessConnectionId: BusinessConnectionId): this(chatId to businessConnectionId)
|
||||||
@@ -196,7 +196,7 @@ object FullChatIdentifierSerializer : KSerializer<ChatIdentifier> {
|
|||||||
when (value) {
|
when (value) {
|
||||||
is ChatId -> encoder.encodeLong(value.chatId.long)
|
is ChatId -> encoder.encodeLong(value.chatId.long)
|
||||||
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
|
is ChatIdWithThreadId -> encoder.encodeString("${value.chatId}/${value.threadId}")
|
||||||
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessId}")
|
is BusinessChatId -> encoder.encodeString("${value.chatId}//${value.businessConnectionId}")
|
||||||
is Username -> encoder.encodeString(value.full)
|
is Username -> encoder.encodeString(value.full)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -151,6 +151,7 @@ const val profileAccentColorIdField = "profile_accent_color_id"
|
|||||||
const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
|
const val backgroundCustomEmojiIdField = "background_custom_emoji_id"
|
||||||
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
|
const val profileBackgroundCustomEmojiIdField = "profile_background_custom_emoji_id"
|
||||||
const val personalChatField = "personal_chat"
|
const val personalChatField = "personal_chat"
|
||||||
|
const val birthdateField = "birthdate"
|
||||||
const val hasVisibleHistoryField = "has_visible_history"
|
const val hasVisibleHistoryField = "has_visible_history"
|
||||||
const val unrestrictBoostsCountField = "unrestrict_boost_count"
|
const val unrestrictBoostsCountField = "unrestrict_boost_count"
|
||||||
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
|
const val customEmojiStickerSetNameField = "custom_emoji_sticker_set_name"
|
||||||
@@ -263,6 +264,10 @@ const val requestUserField = "request_user"
|
|||||||
const val requestUsersField = "request_users"
|
const val requestUsersField = "request_users"
|
||||||
const val requestChatField = "request_chat"
|
const val requestChatField = "request_chat"
|
||||||
const val requestIdField = "request_id"
|
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 maxQuantityField = "max_quantity"
|
||||||
|
|
||||||
const val userIsBotField = "user_is_bot"
|
const val userIsBotField = "user_is_bot"
|
||||||
@@ -374,6 +379,7 @@ const val oldChatMemberField = "old_chat_member"
|
|||||||
const val newChatMemberField = "new_chat_member"
|
const val newChatMemberField = "new_chat_member"
|
||||||
const val stickerTypeField = "sticker_type"
|
const val stickerTypeField = "sticker_type"
|
||||||
const val stickerFormatField = "sticker_format"
|
const val stickerFormatField = "sticker_format"
|
||||||
|
const val formatField = "format"
|
||||||
const val needsRepaintingField = "needs_repainting"
|
const val needsRepaintingField = "needs_repainting"
|
||||||
|
|
||||||
const val okField = "ok"
|
const val okField = "ok"
|
||||||
@@ -419,6 +425,7 @@ const val offsetField = "offset"
|
|||||||
const val limitField = "limit"
|
const val limitField = "limit"
|
||||||
const val stickersField = "stickers"
|
const val stickersField = "stickers"
|
||||||
const val stickerField = "sticker"
|
const val stickerField = "sticker"
|
||||||
|
const val oldStickerField = "old_sticker"
|
||||||
const val keywordsField = "keywords"
|
const val keywordsField = "keywords"
|
||||||
const val urlField = "url"
|
const val urlField = "url"
|
||||||
const val addressField = "address"
|
const val addressField = "address"
|
||||||
@@ -592,3 +599,7 @@ const val businessConnectionIdField = "business_connection_id"
|
|||||||
const val businessIntroField = "business_intro"
|
const val businessIntroField = "business_intro"
|
||||||
const val businessLocationField = "business_location"
|
const val businessLocationField = "business_location"
|
||||||
const val businessOpeningHoursField = "business_opening_hours"
|
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_CHAT_BOOST = "chat_boost"
|
||||||
const val UPDATE_REMOVE_CHAT_BOOST = "removed_chat_boost"
|
const val UPDATE_REMOVE_CHAT_BOOST = "removed_chat_boost"
|
||||||
const val UPDATE_BUSINESS_CONNECTION = "business_connection"
|
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(
|
val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
||||||
UPDATE_MESSAGE,
|
UPDATE_MESSAGE,
|
||||||
@@ -37,7 +40,10 @@ val ALL_UPDATES_LIST_WITHOUT_REACTIONS = listOf(
|
|||||||
UPDATE_CHAT_JOIN_REQUEST,
|
UPDATE_CHAT_JOIN_REQUEST,
|
||||||
UPDATE_CHAT_BOOST,
|
UPDATE_CHAT_BOOST,
|
||||||
UPDATE_REMOVE_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(
|
val ALL_UPDATES_LIST = ALL_UPDATES_LIST_WITHOUT_REACTIONS + listOf(
|
||||||
|
|||||||
@@ -4,15 +4,12 @@ import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
|||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.chat.PreviewUser
|
import dev.inmo.tgbotapi.types.chat.PreviewUser
|
||||||
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
import dev.inmo.tgbotapi.utils.internal.ClassCastsIncluded
|
||||||
import kotlinx.serialization.EncodeDefault
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.KSerializer
|
|
||||||
import kotlinx.serialization.SerialName
|
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
import kotlinx.serialization.descriptors.SerialDescriptor
|
import kotlinx.serialization.descriptors.SerialDescriptor
|
||||||
import kotlinx.serialization.encoding.Decoder
|
import kotlinx.serialization.encoding.Decoder
|
||||||
import kotlinx.serialization.encoding.Encoder
|
import kotlinx.serialization.encoding.Encoder
|
||||||
|
|
||||||
@Serializable
|
@Serializable(BusinessConnection.Companion::class)
|
||||||
@ClassCastsIncluded
|
@ClassCastsIncluded
|
||||||
sealed interface BusinessConnection : WithBusinessConnectionId {
|
sealed interface BusinessConnection : WithBusinessConnectionId {
|
||||||
val id: BusinessConnectionId
|
val id: BusinessConnectionId
|
||||||
@@ -59,6 +56,7 @@ sealed interface BusinessConnection : WithBusinessConnectionId {
|
|||||||
override val isEnabled: Boolean = false
|
override val isEnabled: Boolean = false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Serializer(BusinessConnection::class)
|
||||||
companion object : KSerializer<BusinessConnection> {
|
companion object : KSerializer<BusinessConnection> {
|
||||||
override val descriptor: SerialDescriptor
|
override val descriptor: SerialDescriptor
|
||||||
get() = RawBusinessConnection.serializer().descriptor
|
get() = RawBusinessConnection.serializer().descriptor
|
||||||
@@ -69,8 +67,7 @@ sealed interface BusinessConnection : WithBusinessConnectionId {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun serialize(encoder: Encoder, value: BusinessConnection) {
|
override fun serialize(encoder: Encoder, value: BusinessConnection) {
|
||||||
|
RawBusinessConnection.serializer().serialize(encoder, RawBusinessConnection(value))
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,11 +2,8 @@ package dev.inmo.tgbotapi.types.business_connection
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithOptionalBusinessConnectionId
|
import dev.inmo.tgbotapi.abstracts.types.WithOptionalBusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.MessageId
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.businessConnectionIdField
|
|
||||||
import dev.inmo.tgbotapi.types.chat.PreviewChat
|
import dev.inmo.tgbotapi.types.chat.PreviewChat
|
||||||
import dev.inmo.tgbotapi.types.chatField
|
|
||||||
import dev.inmo.tgbotapi.types.messageIdField
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -16,6 +13,6 @@ data class BusinessMessagesDeleted(
|
|||||||
override val businessConnectionId: BusinessConnectionId,
|
override val businessConnectionId: BusinessConnectionId,
|
||||||
@SerialName(chatField)
|
@SerialName(chatField)
|
||||||
val chat: PreviewChat,
|
val chat: PreviewChat,
|
||||||
@SerialName(messageIdField)
|
@SerialName(messageIdsField)
|
||||||
val messageId: MessageId
|
val messageIds: List<MessageId>
|
||||||
) : WithBusinessConnectionId
|
) : WithBusinessConnectionId
|
||||||
|
|||||||
@@ -12,7 +12,4 @@ data class BusinessOpeningHours(
|
|||||||
val timeZoneName: String,
|
val timeZoneName: String,
|
||||||
@SerialName(openingHoursField)
|
@SerialName(openingHoursField)
|
||||||
val openingHours: List<BusinessOpeningHoursInterval>
|
val openingHours: List<BusinessOpeningHoursInterval>
|
||||||
) {
|
)
|
||||||
val timezone: Timezone
|
|
||||||
get() = Timezone.valueOf(timeZoneName)
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import kotlinx.serialization.SerialName
|
|||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class RawBusinessConnection(
|
internal data class RawBusinessConnection(
|
||||||
@SerialName(idField)
|
@SerialName(idField)
|
||||||
val id: BusinessConnectionId,
|
val id: BusinessConnectionId,
|
||||||
@SerialName(userField)
|
@SerialName(userField)
|
||||||
|
|||||||
@@ -1,15 +1,8 @@
|
|||||||
package dev.inmo.tgbotapi.types.buttons
|
package dev.inmo.tgbotapi.types.buttons
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.botAdministratorRightsField
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.botIsMemberField
|
|
||||||
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
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.request.RequestId
|
||||||
import dev.inmo.tgbotapi.types.requestIdField
|
|
||||||
import dev.inmo.tgbotapi.types.userAdministratorRightsField
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -34,7 +27,13 @@ data class KeyboardButtonRequestChat(
|
|||||||
@SerialName(botAdministratorRightsField)
|
@SerialName(botAdministratorRightsField)
|
||||||
val botRightsInChat: ChatCommonAdministratorRights? = null,
|
val botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
@SerialName(botIsMemberField)
|
@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 {
|
companion object {
|
||||||
fun Channel(
|
fun Channel(
|
||||||
@@ -43,7 +42,10 @@ data class KeyboardButtonRequestChat(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = KeyboardButtonRequestChat(
|
) = KeyboardButtonRequestChat(
|
||||||
requestId = requestId,
|
requestId = requestId,
|
||||||
isChannel = true,
|
isChannel = true,
|
||||||
@@ -52,7 +54,10 @@ data class KeyboardButtonRequestChat(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
|
|
||||||
fun Group(
|
fun Group(
|
||||||
@@ -62,7 +67,10 @@ data class KeyboardButtonRequestChat(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = KeyboardButtonRequestChat(
|
) = KeyboardButtonRequestChat(
|
||||||
requestId = requestId,
|
requestId = requestId,
|
||||||
isChannel = false,
|
isChannel = false,
|
||||||
@@ -71,7 +79,10 @@ data class KeyboardButtonRequestChat(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,6 +19,9 @@ sealed interface KeyboardButtonRequestUsers {
|
|||||||
val isBot: Boolean?
|
val isBot: Boolean?
|
||||||
val isPremium: Boolean?
|
val isPremium: Boolean?
|
||||||
val maxCount: Int
|
val maxCount: Int
|
||||||
|
val requestName: Boolean?
|
||||||
|
val requestUsername: Boolean?
|
||||||
|
val requestPhoto: Boolean?
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class Any(
|
data class Any(
|
||||||
@@ -27,7 +30,13 @@ sealed interface KeyboardButtonRequestUsers {
|
|||||||
@SerialName(userIsPremiumField)
|
@SerialName(userIsPremiumField)
|
||||||
override val isPremium: Boolean? = null,
|
override val isPremium: Boolean? = null,
|
||||||
@SerialName(maxQuantityField)
|
@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 {
|
) : KeyboardButtonRequestUsers {
|
||||||
@SerialName(userIsBotField)
|
@SerialName(userIsBotField)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
@@ -41,7 +50,13 @@ sealed interface KeyboardButtonRequestUsers {
|
|||||||
@SerialName(userIsPremiumField)
|
@SerialName(userIsPremiumField)
|
||||||
override val isPremium: Boolean? = null,
|
override val isPremium: Boolean? = null,
|
||||||
@SerialName(maxQuantityField)
|
@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 {
|
) : KeyboardButtonRequestUsers {
|
||||||
@SerialName(userIsBotField)
|
@SerialName(userIsBotField)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
@@ -53,7 +68,13 @@ sealed interface KeyboardButtonRequestUsers {
|
|||||||
@SerialName(requestIdField)
|
@SerialName(requestIdField)
|
||||||
override val requestId: RequestId,
|
override val requestId: RequestId,
|
||||||
@SerialName(maxQuantityField)
|
@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 {
|
) : KeyboardButtonRequestUsers {
|
||||||
@SerialName(userIsBotField)
|
@SerialName(userIsBotField)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
@@ -73,7 +94,13 @@ sealed interface KeyboardButtonRequestUsers {
|
|||||||
@SerialName(userIsPremiumField)
|
@SerialName(userIsPremiumField)
|
||||||
val userIsPremium: Boolean? = null,
|
val userIsPremium: Boolean? = null,
|
||||||
@SerialName(maxQuantityField)
|
@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()
|
private val realSerializer = Surrogate.serializer()
|
||||||
|
|
||||||
@@ -83,9 +110,29 @@ sealed interface KeyboardButtonRequestUsers {
|
|||||||
val surrogate = realSerializer.deserialize(decoder)
|
val surrogate = realSerializer.deserialize(decoder)
|
||||||
|
|
||||||
return when (surrogate.userIsBot) {
|
return when (surrogate.userIsBot) {
|
||||||
true -> Bot(surrogate.requestId, surrogate.maxCount)
|
true -> Bot(
|
||||||
false -> Common(surrogate.requestId, surrogate.userIsPremium, surrogate.maxCount)
|
requestId = surrogate.requestId,
|
||||||
null -> Any(surrogate.requestId, surrogate.userIsPremium, surrogate.maxCount)
|
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(
|
realSerializer.serialize(
|
||||||
encoder,
|
encoder,
|
||||||
Surrogate(
|
Surrogate(
|
||||||
value.requestId,
|
requestId = value.requestId,
|
||||||
value.isBot,
|
userIsBot = value.isBot,
|
||||||
(value as? Common) ?.isPremium,
|
userIsPremium = (value as? Common) ?.isPremium,
|
||||||
value.maxCount
|
maxCount = value.maxCount,
|
||||||
|
requestName = value.requestName,
|
||||||
|
requestUsername = value.requestUsername,
|
||||||
|
requestPhoto = value.requestPhoto
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,11 @@ import dev.inmo.tgbotapi.types.buttons.*
|
|||||||
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
import dev.inmo.tgbotapi.types.chat.member.ChatCommonAdministratorRights
|
||||||
import dev.inmo.tgbotapi.types.keyboardButtonRequestUserLimit
|
import dev.inmo.tgbotapi.types.keyboardButtonRequestUserLimit
|
||||||
import dev.inmo.tgbotapi.types.request.RequestId
|
import dev.inmo.tgbotapi.types.request.RequestId
|
||||||
|
import dev.inmo.tgbotapi.types.requestNameField
|
||||||
|
import dev.inmo.tgbotapi.types.requestPhotoField
|
||||||
|
import dev.inmo.tgbotapi.types.requestUsernameField
|
||||||
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
import dev.inmo.tgbotapi.types.webapps.WebAppInfo
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
import kotlin.math.max
|
import kotlin.math.max
|
||||||
|
|
||||||
|
|
||||||
@@ -71,10 +75,19 @@ inline fun requestUsersReplyButton(
|
|||||||
inline fun requestBotsReplyButton(
|
inline fun requestBotsReplyButton(
|
||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersReplyButton(
|
) = requestUsersReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Bot(requestId, maxCount)
|
KeyboardButtonRequestUsers.Bot(
|
||||||
|
requestId = requestId,
|
||||||
|
maxCount = maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -84,10 +97,20 @@ inline fun requestUsersReplyButton(
|
|||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
premiumUser: Boolean? = null,
|
premiumUser: Boolean? = null,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersReplyButton(
|
) = requestUsersReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Common(requestId, premiumUser, maxCount)
|
KeyboardButtonRequestUsers.Common(
|
||||||
|
requestId = requestId,
|
||||||
|
isPremium = premiumUser,
|
||||||
|
maxCount = maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -97,12 +120,18 @@ inline fun requestUserReplyButton(
|
|||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
premiumUser: Boolean? = null,
|
premiumUser: Boolean? = null,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersReplyButton(
|
) = requestUsersReplyButton(
|
||||||
text,
|
text,
|
||||||
requestId,
|
requestId,
|
||||||
premiumUser,
|
premiumUser,
|
||||||
maxCount
|
maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -112,10 +141,20 @@ inline fun requestUsersOrBotsReplyButton(
|
|||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
premiumUser: Boolean? = null,
|
premiumUser: Boolean? = null,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersReplyButton(
|
) = requestUsersReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Any(requestId, premiumUser, maxCount)
|
KeyboardButtonRequestUsers.Any(
|
||||||
|
requestId = requestId,
|
||||||
|
isPremium = premiumUser,
|
||||||
|
maxCount = maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -123,10 +162,18 @@ inline fun requestUsersOrBotsReplyButton(
|
|||||||
*/
|
*/
|
||||||
inline fun requestUserOrBotReplyButton(
|
inline fun requestUserOrBotReplyButton(
|
||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId
|
requestId: RequestId,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersReplyButton(
|
) = requestUsersReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Any(requestId)
|
KeyboardButtonRequestUsers.Any(
|
||||||
|
requestId = requestId,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -153,7 +200,10 @@ inline fun requestChatReplyButton(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean = false
|
botIsMember: Boolean = false,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestChatReplyButton(
|
) = requestChatReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestChat(
|
KeyboardButtonRequestChat(
|
||||||
@@ -164,7 +214,10 @@ inline fun requestChatReplyButton(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -178,7 +231,10 @@ inline fun requestChannelReplyButton(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean = false
|
botIsMember: Boolean = false,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestChatReplyButton(
|
) = requestChatReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestChat.Channel(
|
KeyboardButtonRequestChat.Channel(
|
||||||
@@ -187,7 +243,10 @@ inline fun requestChannelReplyButton(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -203,7 +262,10 @@ inline fun requestChannelReplyButton(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestChatReplyButton(
|
) = requestChatReplyButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestChat.Group(
|
KeyboardButtonRequestChat.Group(
|
||||||
@@ -213,6 +275,9 @@ inline fun requestChannelReplyButton(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -133,6 +133,8 @@ data class ExtendedPrivateChatImpl(
|
|||||||
override val businessLocation: BusinessLocation? = null,
|
override val businessLocation: BusinessLocation? = null,
|
||||||
@SerialName(businessOpeningHoursField)
|
@SerialName(businessOpeningHoursField)
|
||||||
override val businessOpeningHours: BusinessOpeningHours? = null,
|
override val businessOpeningHours: BusinessOpeningHours? = null,
|
||||||
|
@SerialName(birthdateField)
|
||||||
|
override val birthdate: Birthdate? = null,
|
||||||
@SerialName(personalChatField)
|
@SerialName(personalChatField)
|
||||||
@Serializable(PreviewChatSerializer::class)
|
@Serializable(PreviewChatSerializer::class)
|
||||||
override val personalChat: PreviewChannelChat? = null
|
override val personalChat: PreviewChannelChat? = null
|
||||||
|
|||||||
@@ -46,6 +46,7 @@ sealed interface ExtendedPrivateChat : PrivateChat, ExtendedChatWithUsername, Ex
|
|||||||
val businessLocation: BusinessLocation?
|
val businessLocation: BusinessLocation?
|
||||||
val businessOpeningHours: BusinessOpeningHours?
|
val businessOpeningHours: BusinessOpeningHours?
|
||||||
|
|
||||||
|
val birthdate: Birthdate?
|
||||||
val personalChat: PreviewChannelChat?
|
val personalChat: PreviewChannelChat?
|
||||||
|
|
||||||
val allowCreateUserIdLink: Boolean
|
val allowCreateUserIdLink: Boolean
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ data class StickerSurrogate(
|
|||||||
val mask_position: MaskPosition? = null,
|
val mask_position: MaskPosition? = null,
|
||||||
val custom_emoji_id: CustomEmojiId? = null,
|
val custom_emoji_id: CustomEmojiId? = null,
|
||||||
val file_size: Long? = null,
|
val file_size: Long? = null,
|
||||||
val needs_repainting: Boolean = false
|
val needs_repainting: Boolean = false,
|
||||||
)
|
)
|
||||||
|
|
||||||
// TODO:: Serializer
|
// TODO:: Serializer
|
||||||
@@ -40,9 +40,9 @@ sealed interface Sticker : TelegramMediaFile, SizedMediaFile, ThumbedMediaFile,
|
|||||||
val stickerFormat: StickerFormat
|
val stickerFormat: StickerFormat
|
||||||
|
|
||||||
val isAnimated
|
val isAnimated
|
||||||
get() = false
|
get() = stickerFormat is StickerFormat.Animated
|
||||||
val isVideo
|
val isVideo
|
||||||
get() = false
|
get() = stickerFormat is StickerFormat.Video
|
||||||
val type: StickerType
|
val type: StickerType
|
||||||
|
|
||||||
fun asInputSticker(emojis: List<String> = emoji ?.let { listOf(it) } ?: error("Unable to create input sticker without emojis")): InputSticker
|
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(
|
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
|
||||||
fileId,
|
fileId,
|
||||||
|
stickerFormat,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
@@ -339,6 +340,7 @@ sealed interface MaskSticker : Sticker {
|
|||||||
|
|
||||||
override fun asInputSticker(emojis: List<String>) = InputSticker.Mask(
|
override fun asInputSticker(emojis: List<String>) = InputSticker.Mask(
|
||||||
fileId,
|
fileId,
|
||||||
|
stickerFormat,
|
||||||
emojis,
|
emojis,
|
||||||
maskPosition
|
maskPosition
|
||||||
)
|
)
|
||||||
@@ -439,6 +441,7 @@ sealed interface CustomEmojiSticker : Sticker {
|
|||||||
|
|
||||||
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.CustomEmoji(
|
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.CustomEmoji(
|
||||||
fileId,
|
fileId,
|
||||||
|
stickerFormat,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
@@ -563,6 +566,7 @@ data class UnknownSticker(
|
|||||||
) : Sticker {
|
) : Sticker {
|
||||||
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
|
override fun asInputSticker(emojis: List<String>) = InputSticker.WithKeywords.Regular(
|
||||||
fileId,
|
fileId,
|
||||||
|
stickerFormat,
|
||||||
emojis,
|
emojis,
|
||||||
emptyList()
|
emptyList()
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -2,9 +2,9 @@ package dev.inmo.tgbotapi.types.message.abstracts
|
|||||||
|
|
||||||
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
import dev.inmo.tgbotapi.abstracts.types.WithBusinessConnectionId
|
||||||
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
import dev.inmo.tgbotapi.types.business_connection.BusinessConnectionId
|
||||||
|
import dev.inmo.tgbotapi.types.chat.Bot
|
||||||
import dev.inmo.tgbotapi.types.chat.PreviewBot
|
import dev.inmo.tgbotapi.types.chat.PreviewBot
|
||||||
import dev.inmo.tgbotapi.types.chat.PreviewBusinessChat
|
import dev.inmo.tgbotapi.types.chat.PreviewBusinessChat
|
||||||
import dev.inmo.tgbotapi.types.chat.PreviewPrivateChat
|
|
||||||
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
import dev.inmo.tgbotapi.types.message.content.MessageContent
|
||||||
|
|
||||||
interface BusinessContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage,
|
interface BusinessContentMessage<T: MessageContent> : PossiblySentViaBotCommonMessage<T>, FromUserMessage,
|
||||||
@@ -12,4 +12,11 @@ interface BusinessContentMessage<T: MessageContent> : PossiblySentViaBotCommonMe
|
|||||||
override val chat: PreviewBusinessChat
|
override val chat: PreviewBusinessChat
|
||||||
override val businessConnectionId: BusinessConnectionId
|
override val businessConnectionId: BusinessConnectionId
|
||||||
val senderBusinessBot: PreviewBot?
|
val senderBusinessBot: PreviewBot?
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Currently, there are only 1-1 business chats and any message in the [chat] sent not by [PreviewBusinessChat.original]
|
||||||
|
* must be sent by bot or user
|
||||||
|
*/
|
||||||
|
val sentByBusinessConnectionOwner: Boolean
|
||||||
|
get() = chat.original.id != from.id && from !is Bot
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.request
|
package dev.inmo.tgbotapi.types.request
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.ChatId
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
import dev.inmo.tgbotapi.types.files.Photo
|
||||||
import dev.inmo.tgbotapi.types.UserId
|
|
||||||
import dev.inmo.tgbotapi.types.chatIdField
|
|
||||||
import dev.inmo.tgbotapi.types.requestIdField
|
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -13,5 +10,11 @@ data class ChatShared(
|
|||||||
@SerialName(requestIdField)
|
@SerialName(requestIdField)
|
||||||
override val requestId: RequestId,
|
override val requestId: RequestId,
|
||||||
@SerialName(chatIdField)
|
@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
|
) : 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
|
package dev.inmo.tgbotapi.types.request
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.types.*
|
import dev.inmo.tgbotapi.types.*
|
||||||
|
import dev.inmo.tgbotapi.types.chat.PreviewUser
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -8,15 +9,30 @@ import kotlinx.serialization.Serializable
|
|||||||
data class UsersShared(
|
data class UsersShared(
|
||||||
@SerialName(requestIdField)
|
@SerialName(requestIdField)
|
||||||
override val requestId: RequestId,
|
override val requestId: RequestId,
|
||||||
@SerialName(userIdsField)
|
@SerialName(usersField)
|
||||||
val userIds: List<UserId>
|
val users: List<SharedUser>
|
||||||
) : ChatSharedRequest {
|
) : ChatSharedRequest {
|
||||||
|
val userIds: List<UserId> by lazy {
|
||||||
|
users.map { it.id }
|
||||||
|
}
|
||||||
val userId: UserId
|
val userId: UserId
|
||||||
get() = userIds.first()
|
get() = userIds.first()
|
||||||
constructor(
|
constructor(
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
userId: UserId
|
user: SharedUser
|
||||||
) : this(requestId, listOf(userId))
|
) : this(requestId, listOf(user))
|
||||||
|
|
||||||
override val chatId: ChatId
|
override val chatId: ChatId
|
||||||
get() = userId
|
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 name: StickerSetName
|
||||||
val title: String
|
val title: String
|
||||||
val stickerType: StickerType
|
val stickerType: StickerType
|
||||||
val stickerFormat: StickerFormat
|
|
||||||
val stickers: List<Sticker>
|
val stickers: List<Sticker>
|
||||||
val isAnimated: Boolean
|
|
||||||
get() = false
|
|
||||||
val isVideo: Boolean
|
|
||||||
get() = false
|
|
||||||
val thumbnail: PhotoSize?
|
val thumbnail: PhotoSize?
|
||||||
|
|
||||||
object Serializer : KSerializer<StickerSet> {
|
object Serializer : KSerializer<StickerSet> {
|
||||||
@@ -42,69 +37,33 @@ sealed interface StickerSet {
|
|||||||
|
|
||||||
return when (surrogate.sticker_type) {
|
return when (surrogate.sticker_type) {
|
||||||
StickerType.CustomEmoji -> when {
|
StickerType.CustomEmoji -> when {
|
||||||
surrogate.is_animated == true -> CustomEmojiAnimatedStickerSet(
|
else -> CustomEmojiStickerSet(
|
||||||
surrogate.name,
|
surrogate.name,
|
||||||
surrogate.title,
|
surrogate.title,
|
||||||
surrogate.stickers.filterIsInstance<CustomEmojiAnimatedSticker>(),
|
surrogate.stickers.filterIsInstance<CustomEmojiSticker>(),
|
||||||
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.thumb
|
surrogate.thumb
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
StickerType.Mask -> when {
|
StickerType.Mask -> when {
|
||||||
surrogate.is_animated == true -> MaskAnimatedStickerSet(
|
else -> MaskStickerSet(
|
||||||
surrogate.name,
|
surrogate.name,
|
||||||
surrogate.title,
|
surrogate.title,
|
||||||
surrogate.stickers.filterIsInstance<MaskAnimatedSticker>(),
|
surrogate.stickers.filterIsInstance<MaskSticker>(),
|
||||||
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.thumb
|
surrogate.thumb
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
StickerType.Regular -> when {
|
StickerType.Regular -> when {
|
||||||
surrogate.is_animated == true -> RegularAnimatedStickerSet(
|
else -> RegularStickerSet(
|
||||||
surrogate.name,
|
surrogate.name,
|
||||||
surrogate.title,
|
surrogate.title,
|
||||||
surrogate.stickers.filterIsInstance<RegularAnimatedSticker>(),
|
surrogate.stickers.filterIsInstance<RegularSticker>(),
|
||||||
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.thumb
|
surrogate.thumb
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
is StickerType.Unknown -> UnknownStickerSet(
|
is StickerType.Unknown -> UnknownStickerSet(
|
||||||
surrogate.name,
|
surrogate.name,
|
||||||
surrogate.title,
|
surrogate.title,
|
||||||
surrogate.stickers.filterIsInstance<RegularSimpleSticker>(),
|
surrogate.stickers.filterIsInstance<RegularSticker>(),
|
||||||
surrogate.sticker_type,
|
surrogate.sticker_type,
|
||||||
surrogate.thumb,
|
surrogate.thumb,
|
||||||
json
|
json
|
||||||
@@ -119,180 +78,48 @@ sealed interface StickerSet {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
sealed interface AnimatedStickerSet : StickerSet {
|
data class RegularStickerSet(
|
||||||
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(
|
|
||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<RegularSimpleSticker>,
|
override val stickers: List<RegularSticker>,
|
||||||
@SerialName(thumbnailField)
|
@SerialName(thumbnailField)
|
||||||
override val thumbnail: PhotoSize? = null
|
override val thumbnail: PhotoSize? = null
|
||||||
) : RegularStickerSet {
|
) : StickerSet {
|
||||||
@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 {
|
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
override val stickerType: StickerType = StickerType.Regular
|
override val stickerType: StickerType = StickerType.Regular
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class RegularVideoStickerSet(
|
data class MaskStickerSet(
|
||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<RegularVideoSticker>,
|
override val stickers: List<MaskSticker>,
|
||||||
@SerialName(thumbnailField)
|
@SerialName(thumbnailField)
|
||||||
override val thumbnail: PhotoSize? = null
|
override val thumbnail: PhotoSize? = null
|
||||||
) : RegularStickerSet, VideoStickerSet {
|
) : StickerSet {
|
||||||
@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 {
|
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
override val stickerType: StickerType = StickerType.Mask
|
override val stickerType: StickerType = StickerType.Mask
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class MaskVideoStickerSet(
|
data class CustomEmojiStickerSet(
|
||||||
@SerialName(nameField)
|
@SerialName(nameField)
|
||||||
override val name: StickerSetName,
|
override val name: StickerSetName,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(stickersField)
|
@SerialName(stickersField)
|
||||||
override val stickers: List<MaskVideoSticker>,
|
override val stickers: List<CustomEmojiSticker>,
|
||||||
@SerialName(thumbnailField)
|
@SerialName(thumbnailField)
|
||||||
override val thumbnail: PhotoSize? = null
|
override val thumbnail: PhotoSize? = null
|
||||||
) : MaskStickerSet, VideoStickerSet {
|
) : StickerSet {
|
||||||
@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 {
|
|
||||||
@SerialName(stickerTypeField)
|
@SerialName(stickerTypeField)
|
||||||
@EncodeDefault
|
@EncodeDefault
|
||||||
override val stickerType: StickerType = StickerType.CustomEmoji
|
override val stickerType: StickerType = StickerType.CustomEmoji
|
||||||
@@ -311,4 +138,4 @@ data class UnknownStickerSet(
|
|||||||
@SerialName(thumbnailField)
|
@SerialName(thumbnailField)
|
||||||
override val thumbnail: PhotoSize? = null,
|
override val thumbnail: PhotoSize? = null,
|
||||||
val raw: JsonElement
|
val raw: JsonElement
|
||||||
) : CustomEmojiStickerSet, VideoStickerSet
|
) : StickerSet
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ internal data class RawUpdate constructor(
|
|||||||
private val message_reaction_count: ChatMessageReactionsCountUpdated? = null,
|
private val message_reaction_count: ChatMessageReactionsCountUpdated? = null,
|
||||||
private val chat_boost: ChatBoostUpdated? = null,
|
private val chat_boost: ChatBoostUpdated? = null,
|
||||||
private val removed_chat_boost: ChatBoostRemoved? = null,
|
private val removed_chat_boost: ChatBoostRemoved? = null,
|
||||||
|
@Serializable(BusinessConnection.Companion::class)
|
||||||
private val business_connection: BusinessConnection? = null,
|
private val business_connection: BusinessConnection? = null,
|
||||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||||
private val business_message: BusinessContentMessage<*>? = null,
|
private val business_message: BusinessContentMessage<*>? = null,
|
||||||
|
|||||||
@@ -3196,27 +3196,29 @@ public final class dev/inmo/tgbotapi/extensions/utils/types/buttons/ReplyKeyboar
|
|||||||
public static synthetic fun flatReplyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
public static synthetic fun flatReplyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||||
public static final fun replyKeyboard (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
public static final fun replyKeyboard (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||||
public static synthetic fun replyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
public static synthetic fun replyKeyboard$default (Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/String;Ljava/lang/Boolean;Ljava/lang/Boolean;Lkotlin/jvm/functions/Function1;ILjava/lang/Object;)Ldev/inmo/tgbotapi/types/buttons/ReplyKeyboardMarkup;
|
||||||
public static final fun requestBotButton-k9yqfdo (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;S)Z
|
public static final fun requestBotButton-6J3sOes (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static final fun requestBotsButton-t22p7TQ (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SI)Z
|
public static synthetic fun requestBotButton-6J3sOes$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static synthetic fun requestBotsButton-t22p7TQ$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SIILjava/lang/Object;)Z
|
public static final fun requestBotsButton-6xNxnbw (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static final fun requestChannelButton-XjXd-ic (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;)Z
|
public static synthetic fun requestBotsButton-6xNxnbw$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static synthetic fun requestChannelButton-XjXd-ic$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
public static final fun requestChannelButton-cvDvKfo (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
|
public static synthetic fun requestChannelButton-cvDvKfo$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun requestChatButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestChat;)Z
|
public static final fun requestChatButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestChat;)Z
|
||||||
public static final fun requestChatButton-Lj92p0I (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;)Z
|
public static final fun requestChatButton-n4yCVdQ (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static synthetic fun requestChatButton-Lj92p0I$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
public static synthetic fun requestChatButton-n4yCVdQ$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun requestContactButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;)Z
|
public static final fun requestContactButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;)Z
|
||||||
public static final fun requestGroupButton-GP8XSDU (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;)Z
|
public static final fun requestGroupButton-dh25vGQ (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static synthetic fun requestGroupButton-GP8XSDU$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
public static synthetic fun requestGroupButton-dh25vGQ$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ldev/inmo/tgbotapi/types/chat/member/ChatCommonAdministratorRights;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun requestLocationButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;)Z
|
public static final fun requestLocationButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;)Z
|
||||||
public static final fun requestPollButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonPollType;)Z
|
public static final fun requestPollButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonPollType;)Z
|
||||||
public static final fun requestUserButton-t22p7TQ (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;)Z
|
public static final fun requestUserButton-6xNxnbw (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static synthetic fun requestUserButton-t22p7TQ$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;ILjava/lang/Object;)Z
|
public static synthetic fun requestUserButton-6xNxnbw$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun requestUserOrBotButton-k9yqfdo (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;S)Z
|
public static final fun requestUserOrBotButton-6J3sOes (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
|
public static synthetic fun requestUserOrBotButton-6J3sOes$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun requestUsersButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;)Z
|
public static final fun requestUsersButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/buttons/KeyboardButtonRequestUsers;)Z
|
||||||
public static final fun requestUsersButton-0GQog4c (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;I)Z
|
public static final fun requestUsersButton-XjXd-ic (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;ILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static synthetic fun requestUsersButton-0GQog4c$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;IILjava/lang/Object;)Z
|
public static synthetic fun requestUsersButton-XjXd-ic$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;ILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun requestUsersOrBotsButton-0GQog4c (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;I)Z
|
public static final fun requestUsersOrBotsButton-XjXd-ic (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;ILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;)Z
|
||||||
public static synthetic fun requestUsersOrBotsButton-0GQog4c$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;IILjava/lang/Object;)Z
|
public static synthetic fun requestUsersOrBotsButton-XjXd-ic$default (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;SLjava/lang/Boolean;ILjava/lang/Boolean;Ljava/lang/Boolean;Ljava/lang/Boolean;ILjava/lang/Object;)Z
|
||||||
public static final fun simpleButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;)Z
|
public static final fun simpleButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;)Z
|
||||||
public static final fun webAppButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/webapps/WebAppInfo;)Z
|
public static final fun webAppButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ldev/inmo/tgbotapi/types/webapps/WebAppInfo;)Z
|
||||||
public static final fun webAppButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;)Z
|
public static final fun webAppButton (Ldev/inmo/tgbotapi/utils/RowBuilder;Ljava/lang/String;Ljava/lang/String;)Z
|
||||||
|
|||||||
@@ -158,10 +158,19 @@ inline fun ReplyKeyboardRowBuilder.requestUsersButton(
|
|||||||
inline fun ReplyKeyboardRowBuilder.requestBotsButton(
|
inline fun ReplyKeyboardRowBuilder.requestBotsButton(
|
||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersButton(
|
) = requestUsersButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Bot(requestId, maxCount)
|
KeyboardButtonRequestUsers.Bot(
|
||||||
|
requestId = requestId,
|
||||||
|
maxCount = maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -172,11 +181,17 @@ inline fun ReplyKeyboardRowBuilder.requestBotsButton(
|
|||||||
*/
|
*/
|
||||||
inline fun ReplyKeyboardRowBuilder.requestBotButton(
|
inline fun ReplyKeyboardRowBuilder.requestBotButton(
|
||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId
|
requestId: RequestId,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestBotsButton(
|
) = requestBotsButton(
|
||||||
text,
|
text,
|
||||||
requestId,
|
requestId,
|
||||||
maxCount = keyboardButtonRequestUserLimit.first
|
maxCount = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -189,10 +204,20 @@ inline fun ReplyKeyboardRowBuilder.requestUsersButton(
|
|||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
premiumUser: Boolean? = null,
|
premiumUser: Boolean? = null,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersButton(
|
) = requestUsersButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Common(requestId, premiumUser, maxCount)
|
KeyboardButtonRequestUsers.Common(
|
||||||
|
requestId = requestId,
|
||||||
|
isPremium = premiumUser,
|
||||||
|
maxCount = maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -204,8 +229,19 @@ inline fun ReplyKeyboardRowBuilder.requestUsersButton(
|
|||||||
inline fun ReplyKeyboardRowBuilder.requestUserButton(
|
inline fun ReplyKeyboardRowBuilder.requestUserButton(
|
||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
premiumUser: Boolean? = null
|
premiumUser: Boolean? = null,
|
||||||
) = requestUsersButton(text, requestId, premiumUser, maxCount = keyboardButtonRequestUserLimit.first)
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
|
) = requestUsersButton(
|
||||||
|
text = text,
|
||||||
|
requestId = requestId,
|
||||||
|
premiumUser = premiumUser,
|
||||||
|
maxCount = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates and put [RequestUserKeyboardButton] with [KeyboardButtonRequestUsers.Any]
|
* Creates and put [RequestUserKeyboardButton] with [KeyboardButtonRequestUsers.Any]
|
||||||
@@ -217,10 +253,20 @@ inline fun ReplyKeyboardRowBuilder.requestUsersOrBotsButton(
|
|||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId,
|
requestId: RequestId,
|
||||||
premiumUser: Boolean? = null,
|
premiumUser: Boolean? = null,
|
||||||
maxCount: Int = keyboardButtonRequestUserLimit.first
|
maxCount: Int = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersButton(
|
) = requestUsersButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestUsers.Any(requestId, premiumUser, maxCount)
|
KeyboardButtonRequestUsers.Any(
|
||||||
|
requestId = requestId,
|
||||||
|
isPremium = premiumUser,
|
||||||
|
maxCount = maxCount,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto
|
||||||
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -231,11 +277,17 @@ inline fun ReplyKeyboardRowBuilder.requestUsersOrBotsButton(
|
|||||||
*/
|
*/
|
||||||
inline fun ReplyKeyboardRowBuilder.requestUserOrBotButton(
|
inline fun ReplyKeyboardRowBuilder.requestUserOrBotButton(
|
||||||
text: String,
|
text: String,
|
||||||
requestId: RequestId
|
requestId: RequestId,
|
||||||
|
requestName: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestUsersOrBotsButton(
|
) = requestUsersOrBotsButton(
|
||||||
text,
|
text = text,
|
||||||
requestId,
|
requestId = requestId,
|
||||||
maxCount = keyboardButtonRequestUserLimit.first
|
maxCount = keyboardButtonRequestUserLimit.first,
|
||||||
|
requestName = requestName,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -270,7 +322,10 @@ inline fun ReplyKeyboardRowBuilder.requestChatButton(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestChatButton(
|
) = requestChatButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestChat(
|
KeyboardButtonRequestChat(
|
||||||
@@ -281,7 +336,10 @@ inline fun ReplyKeyboardRowBuilder.requestChatButton(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -298,7 +356,10 @@ inline fun ReplyKeyboardRowBuilder.requestChannelButton(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestChatButton(
|
) = requestChatButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestChat.Channel(
|
KeyboardButtonRequestChat.Channel(
|
||||||
@@ -307,7 +368,10 @@ inline fun ReplyKeyboardRowBuilder.requestChannelButton(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -325,7 +389,10 @@ inline fun ReplyKeyboardRowBuilder.requestGroupButton(
|
|||||||
isOwnedBy: Boolean? = null,
|
isOwnedBy: Boolean? = null,
|
||||||
userRightsInChat: ChatCommonAdministratorRights? = null,
|
userRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botRightsInChat: ChatCommonAdministratorRights? = null,
|
botRightsInChat: ChatCommonAdministratorRights? = null,
|
||||||
botIsMember: Boolean? = null
|
botIsMember: Boolean? = null,
|
||||||
|
requestTitle: Boolean? = null,
|
||||||
|
requestUsername: Boolean? = null,
|
||||||
|
requestPhoto: Boolean? = null,
|
||||||
) = requestChatButton(
|
) = requestChatButton(
|
||||||
text,
|
text,
|
||||||
KeyboardButtonRequestChat.Group(
|
KeyboardButtonRequestChat.Group(
|
||||||
@@ -335,6 +402,9 @@ inline fun ReplyKeyboardRowBuilder.requestGroupButton(
|
|||||||
isOwnedBy = isOwnedBy,
|
isOwnedBy = isOwnedBy,
|
||||||
userRightsInChat = userRightsInChat,
|
userRightsInChat = userRightsInChat,
|
||||||
botRightsInChat = botRightsInChat,
|
botRightsInChat = botRightsInChat,
|
||||||
botIsMember = botIsMember
|
botIsMember = botIsMember,
|
||||||
|
requestTitle = requestTitle,
|
||||||
|
requestUsername = requestUsername,
|
||||||
|
requestPhoto = requestPhoto,
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.webapps
|
package dev.inmo.tgbotapi.webapps
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
|
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.cloud.CloudStorage
|
||||||
import dev.inmo.tgbotapi.webapps.haptic.HapticFeedback
|
import dev.inmo.tgbotapi.webapps.haptic.HapticFeedback
|
||||||
import dev.inmo.tgbotapi.webapps.invoice.InvoiceClosedInfo
|
import dev.inmo.tgbotapi.webapps.invoice.InvoiceClosedInfo
|
||||||
@@ -54,6 +55,9 @@ external class WebApp {
|
|||||||
@JsName("CloudStorage")
|
@JsName("CloudStorage")
|
||||||
val cloudStorage: CloudStorage
|
val cloudStorage: CloudStorage
|
||||||
|
|
||||||
|
@JsName("BiometricManager")
|
||||||
|
val biometricManager: BiometricManager
|
||||||
|
|
||||||
@JsName("SettingsButton")
|
@JsName("SettingsButton")
|
||||||
val settingsButton: 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