1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-11-16 12:00:18 +00:00

Compare commits

...

1291 Commits

Author SHA1 Message Date
e626d8b5cc fix dependencies and fill changelog 2022-12-08 10:30:26 +06:00
b906d605f4 temporal include of internal microutils build 2022-12-08 09:35:22 +06:00
d3584e793c add makeChatLink 2022-12-08 09:17:58 +06:00
f71ac51461 improve makeLinkToMessage 2022-12-08 09:06:54 +06:00
5fe8cf948a start 4.2.1 2022-12-08 08:57:54 +06:00
85ea101641 Merge pull request #691 from InsanusMokrassar/4.2.0
4.2.0
2022-12-05 11:52:47 +06:00
dc3ecec5c7 Update CHANGELOG.md 2022-12-05 11:51:46 +06:00
ebd5e1a37b Update libs.versions.toml 2022-12-05 05:57:43 +06:00
3da2e4fffb starr 4.2.0 2022-12-05 05:55:15 +06:00
9aea59b44b Update gradle-wrapper.properties 2022-11-28 16:37:50 +06:00
7bab96a9cd Merge pull request #686 from InsanusMokrassar/4.1.3
4.1.3
2022-11-28 16:35:58 +06:00
a0c10d9a9a Update CHANGELOG.md 2022-11-27 17:38:24 +06:00
e2901cb9f9 Update libs.versions.toml 2022-11-27 17:38:16 +06:00
3c60d074ba Update CHANGELOG.md 2022-11-24 19:28:32 +06:00
f10cfdc5f1 Update libs.versions.toml 2022-11-24 19:27:56 +06:00
270f9a60c1 fixes 2022-11-20 13:28:23 +06:00
2b49a75a42 UserId = ChatId 2022-11-20 13:21:20 +06:00
9f7a348000 fill changelog 2022-11-18 23:08:16 +06:00
8cec74aa6a fix in gitea publishing name 2022-11-18 22:22:03 +06:00
d1914c8045 update order of publishing steps 2022-11-18 22:16:47 +06:00
baeb4848cf test version with outs variations of content message generics 2022-11-18 22:11:03 +06:00
dbadcb3f5a Merge pull request #685 from InsanusMokrassar/4.1.2
4.1.2
2022-11-17 12:55:37 +06:00
13dd73dd63 update dependencies 2022-11-17 12:34:33 +06:00
ceba86abcb Fixes in CallbackQuery waiters 2022-11-17 12:33:16 +06:00
f6a0b1a19d start 4.1.2 2022-11-17 12:30:26 +06:00
4ed6e5c7b2 add gitea publication 2022-11-17 11:26:05 +06:00
7f43dc0815 Merge pull request #684 from InsanusMokrassar/4.1.1
4.1.1
2022-11-14 23:24:03 +06:00
c72993017f FullChatIdentifierSerializer 2022-11-11 21:44:37 +06:00
e8991f8f89 Add opportunity to create "IdChatIdentifier" with optional "threadId" 2022-11-11 12:59:42 +06:00
03cd4276a9 start 4.1.1 2022-11-11 12:58:11 +06:00
4427d76cd1 Update FUNDING.yml 2022-11-10 20:50:36 +06:00
00f504a095 Merge pull request #682 from InsanusMokrassar/4.1.0
4.1.0
2022-11-10 20:18:52 +06:00
d167f10724 update dependencies 2022-11-10 17:02:47 +06:00
a1ccbbdd51 small additions in changelog 2022-11-10 16:48:10 +06:00
925c4dae6c ChatIdWithThreadId, all chats ids now value classes, update chats ids hierarchy 2022-11-10 16:25:55 +06:00
1ec4507891 add new type of chats ids 2022-11-10 15:56:38 +06:00
236e47478f update ChatIdentifierWithThreadId and kdocs 2022-11-10 12:05:59 +06:00
f2f15d7173 Update ChatIdentifierWithThreadId.kt 2022-11-10 09:24:32 +06:00
1b8ee5c4d7 Update ChatIdentifierWithThreadId.kt 2022-11-10 09:16:46 +06:00
304b281d80 Update ChatIdentifierWithThreadId.kt 2022-11-10 09:13:31 +06:00
733ad34289 Create ChatIdentifierWithThreadId.kt 2022-11-10 09:11:13 +06:00
39335b1dab Update gradle.properties 2022-11-10 09:01:14 +06:00
46fdbc02e8 Merge pull request #675 from InsanusMokrassar/4.0.0
4.0.0
2022-11-09 00:14:48 +06:00
fbe8c9419d add send extensions with sendLiveLocations 2022-11-08 22:23:32 +06:00
aba5810319 update supporting version of bot api 2022-11-08 22:14:18 +06:00
7d7658c64f add forumMessage/notForumMessage extensions 2022-11-08 22:11:44 +06:00
c4fdc350ce add MessageFilterForums 2022-11-08 22:02:49 +06:00
f700fab33f Revert "update kotlin version"
This reverts commit f078041dec.
2022-11-08 21:45:59 +06:00
f078041dec update kotlin version 2022-11-08 21:43:15 +06:00
dd6b688ae4 update deleteForumTopic 2022-11-08 17:29:43 +06:00
0d37147a36 add events waiters and triggers for topics 2022-11-08 15:07:37 +06:00
ee0c017a79 add extensions sameTopic/sameThread Message 2022-11-08 15:07:37 +06:00
b5d5eeb62d Update libs.versions.toml 2022-11-08 13:10:47 +06:00
d715bc0a9e Merge pull request #677 from InsanusMokrassar/task/676-rework_of_media_groups
676 Rework of media groups
2022-11-08 13:09:21 +06:00
113621f619 Merge branch '4.0.0' into task/676-rework_of_media_groups 2022-11-08 13:07:55 +06:00
6a899f1217 add threadIdOrNull extension 2022-11-08 13:07:16 +06:00
6bc96162a8 add waiters and small improvement of triggers 2022-11-08 12:17:56 +06:00
4736610aa8 several fixes 2022-11-08 02:50:22 +06:00
f6f07a5e8a fixes 2022-11-08 02:27:38 +06:00
b32ce88a97 fixes 2022-11-08 01:51:27 +06:00
47f514a635 Merge branch '4.0.0' into task/676-rework_of_media_groups 2022-11-08 00:36:46 +06:00
a80ed2ec57 fixes in replies 2022-11-08 00:21:16 +06:00
b1bba43f29 update api according to new topics api 2022-11-08 00:11:14 +06:00
9df258805d add support of threads in send requests of core module 2022-11-07 23:02:58 +06:00
8654437293 add TelegramBot#getForumTopicIconStickers 2022-11-06 16:01:05 +06:00
bdbca92fe5 add api extensions for topics requests 2022-11-06 15:55:15 +06:00
aca4d90608 add support of forum requests 2022-11-06 15:29:48 +06:00
ad75aef64f add support of forum topic service messages 2022-11-06 14:56:01 +06:00
5bf30bc6c6 fix 2022-11-06 14:28:16 +06:00
acd3298d4d active_usernames support 2022-11-06 14:26:51 +06:00
3f6f04d00f add support of emoji_status_custom_emoji_id 2022-11-06 14:21:28 +06:00
c7f372c1e3 can_manage_topics support 2022-11-06 14:18:34 +06:00
1ed620df85 add support of message thread id in media group messages 2022-11-06 14:10:09 +06:00
541e00fa03 start rework 2022-11-06 14:07:31 +06:00
867a46d397 add support of forum chats 2022-11-06 12:51:53 +06:00
8f4eb74e39 Update CHANGELOG.md 2022-11-05 20:07:23 +06:00
16cc49e412 start 4.0.0 2022-11-05 20:05:18 +06:00
f58614e5be Merge pull request #674 from InsanusMokrassar/renovate/ksp
Update ksp to v1.7.20-1.0.8
2022-11-05 01:16:51 +06:00
renovate[bot]
c3a09b53fc Update ksp to v1.7.20-1.0.8 2022-11-03 23:26:46 +00:00
c8413e1d18 Merge pull request #671 from InsanusMokrassar/3.3.1
3.3.1
2022-11-01 12:43:18 +06:00
8b15296ee7 Update CHANGELOG.md 2022-11-01 12:41:35 +06:00
0fcc717269 Update libs.versions.toml 2022-11-01 12:41:24 +06:00
2ce26b4f1e Update CHANGELOG.md 2022-10-31 02:28:23 +06:00
b5d499b623 Update libs.versions.toml 2022-10-31 02:27:23 +06:00
102515dc8a Update CHANGELOG.md 2022-10-31 02:25:16 +06:00
777a58ce9a a little bit refactor hasCommands 2022-10-30 20:10:12 +06:00
7471da4ff0 update version of library 2022-10-30 19:48:04 +06:00
e753db0e71 Merge pull request #662 from InsanusMokrassar/renovate/korlibs
Update korlibs to v3.3.0
2022-10-28 18:54:53 +06:00
70984424e3 Merge pull request #669 from madhead/feature/initial-filters
Add `hasCommands` / `hasNoCommands` extensions on `CommonMessage`
2022-10-28 18:54:16 +06:00
c8354a330e Merge pull request #670 from InsanusMokrassar/renovate/ktor
Update ktor to v2.1.3
2022-10-28 18:53:38 +06:00
037ad8b87c Update gradle.properties 2022-10-28 18:51:52 +06:00
renovate[bot]
89550107d6 Update ktor to v2.1.3 2022-10-28 11:44:50 +00:00
madhead
86cc7cfb3d Add hasCommands / hasNoCommands extensions on CommonMessage
These extensions are meant to be used as arguments to the `initialFilter` parameter in behaviour builder triggers.
2022-10-24 03:46:30 +02:00
renovate[bot]
858586e608 Update korlibs to v3.3.0 2022-10-23 00:42:04 +00:00
d9846f27c9 Merge pull request #665 from InsanusMokrassar/3.3.0
3.3.0
2022-10-22 18:00:02 +06:00
c10da2a10a Update CHANGELOG.md 2022-10-22 17:59:54 +06:00
8ed216619d deprecate TelegramBot#getStickerSet 2022-10-22 17:41:55 +06:00
62a9c687d5 update dependencies and changelog 2022-10-22 14:33:43 +06:00
c2918c308f Merge pull request #668 from d1snin/wait-command-message
Added `BehaviourContext.waitCommandMessage` supporting `BotCommand`
2022-10-20 06:56:06 +06:00
d1snin
81fbff0bf5 added BehaviourContext.waitCommandMessage supporting BotCommand 2022-10-19 22:15:15 +03:00
54fb58de81 Update CHANGELOG.md 2022-10-19 19:25:01 +06:00
94ed4fed10 Update libs.versions.toml 2022-10-19 19:19:14 +06:00
63ceec70ca Merge pull request #664 from d1snin/bot-command
added `EntitiesBuilder.botCommand` and `EntitiesBuilder.botCommandln`…
2022-10-13 23:32:58 +06:00
636382fc8f Update EntitiesBuilder.kt 2022-10-13 23:31:41 +06:00
ac7bf60182 Update BotCommandTextSource.kt 2022-10-13 23:30:34 +06:00
bd91d4a0c0 Update CommandHandling.kt 2022-10-13 23:29:36 +06:00
d1snin
7488eb9d4b added botCommand text source factory function supporting BotCommand 2022-10-13 19:56:26 +03:00
6fcd248aff update microutils 2022-10-13 18:25:44 +06:00
5fa1804003 start 0.3.3 2022-10-13 18:24:59 +06:00
d1snin
0c9919e9e7 added command handling functions supporting BotCommand 2022-10-12 21:04:20 +03:00
d1snin
9405aa4467 added EntitiesBuilder.botCommand and EntitiesBuilder.botCommandln overloads supporting BotCommand 2022-10-12 20:57:42 +03:00
4f75bc792d Merge pull request #659 from InsanusMokrassar/3.2.7
3.2.7
2022-10-01 23:36:51 +06:00
fda53cf171 update dependencies 2022-10-01 22:09:01 +06:00
b588622c3d deprecate old row methods for keyboard builders 2022-09-28 20:48:55 +06:00
8b64a0c94e keyboard builders become typealiases 2022-09-28 20:38:16 +06:00
959f0dffba start 3.2.7 2022-09-28 20:02:45 +06:00
8fc9185884 Merge pull request #656 from InsanusMokrassar/3.2.6
3.2.6
2022-09-19 14:59:34 +06:00
3a9cf03958 add edit extensions with builders of text sources 2022-09-19 14:34:19 +06:00
7cd97ac779 All the extensions related to text messages (replies, sending, editing) got their duplicates with buildEntities lambda and separator 2022-09-19 13:52:14 +06:00
c460b4eacc small refactoring inside of entities builder 2022-09-19 12:57:22 +06:00
0aa58bd9f6 improve deprecation messages in old entities builder 2022-09-19 12:10:17 +06:00
a4a82f69c6 replace entities builder 2022-09-19 11:18:01 +06:00
d450ed9126 Fixes in ChatMemberSerializer#serialize method 2022-09-19 02:17:40 +06:00
69c5f1ae7d start 3.2.6 2022-09-19 02:16:12 +06:00
e4e8eadfb5 Merge pull request #655 from InsanusMokrassar/3.2.5
3.2.5
2022-09-19 01:51:49 +06:00
c1374c118d Improve support of new exceptions recovering mechanism 2022-09-19 01:39:23 +06:00
6004b159ec 3.2.5 2022-09-19 00:17:30 +06:00
67f95682d5 Merge pull request #654 from InsanusMokrassar/3.2.4
3.2.4
2022-09-16 21:29:21 +06:00
5aa5460a43 new edits 2022-09-16 16:36:21 +06:00
e937845fc7 start 3.2.4 2022-09-16 15:43:40 +06:00
96f40e55bc Merge pull request #653 from InsanusMokrassar/3.2.3
3.2.3
2022-09-15 15:28:54 +06:00
d3d8603c35 upfix 2022-09-15 15:22:08 +06:00
759650892c fix in DeleteMyCommands 2022-09-15 15:06:19 +06:00
b58550a9ec start 3.2.3 2022-09-15 15:05:38 +06:00
e15817e7c5 Merge pull request #652 from InsanusMokrassar/3.2.2
3.2.2
2022-09-15 13:11:29 +06:00
4cd1316e27 fix build 2022-09-15 12:46:17 +06:00
3575a62f34 MessageIdentifier -> MessageId, replies with chatsIds/messageIds 2022-09-15 00:17:18 +06:00
82f7d5bd4f start 3.2.2 2022-09-15 00:02:22 +06:00
7a5e6a69a1 Update README.md 2022-09-14 10:58:03 +06:00
fd25db5633 Merge pull request #651 from InsanusMokrassar/3.2.1
3.2.1
2022-09-08 14:45:27 +06:00
f539a24740 Update CHANGELOG.md 2022-09-08 14:36:10 +06:00
1d7b4ea862 Update libs.versions.toml 2022-09-08 14:35:17 +06:00
2d6f296c20 update dependencies 2022-09-07 16:33:29 +06:00
0ba1aa1127 start 3.2.1 2022-09-07 16:32:37 +06:00
ae8a461e9d Merge pull request #648 from InsanusMokrassar/3.2.0
3.2.0
2022-08-26 16:36:27 +06:00
99f16e33a6 Update CHANGELOG.md 2022-08-26 12:44:11 +06:00
e029b29f7f fixes 2022-08-26 12:20:20 +06:00
c04f795fdd migrate onto 3.2.0 from 3.1.2 2022-08-26 11:00:36 +06:00
b873898100 wrap client request exception into exception handling 2022-08-25 13:35:15 +06:00
61ac9df5e3 BotException 2022-08-25 13:32:12 +06:00
b1931900e7 Update BotCommandTextSource.kt 2022-08-25 02:11:04 +06:00
fab3af48d6 Update WaitCommandsMessages.kt 2022-08-25 02:04:19 +06:00
8d7563b6e4 Update WaitCommandsMessages.kt 2022-08-25 02:02:45 +06:00
05112afe0c add deeplinks triggers 2022-08-24 15:32:34 +06:00
9ea06de27c add waitCommands* expectations 2022-08-24 15:03:54 +06:00
fff05a40d9 revert adding of mention waiters 2022-08-24 13:29:57 +06:00
5c6428f220 update microutils 2022-08-23 13:13:06 +06:00
766b7ca205 add waiters for mentions 2022-08-23 13:12:22 +06:00
41e6c52369 allowedUpdates is ALL_UPDATES_LIST by default everywhere 2022-08-23 11:55:28 +06:00
06013f624f update dependencies 2022-08-23 11:48:55 +06:00
d8bba89f3f start 3.1.2 2022-08-23 11:47:31 +06:00
141281f96d Merge pull request #643 from InsanusMokrassar/3.1.1
3.1.1
2022-08-15 01:31:59 +06:00
be7aaa7845 fixes and improvements in webapps 2022-08-15 01:29:24 +06:00
78c224ffa8 fix on asUser fun 2022-08-15 01:21:10 +06:00
a08d07f7b3 fixes in popup params and buttons 2022-08-15 01:20:29 +06:00
69dde19543 Update CHANGELOG.md 2022-08-14 22:13:03 +06:00
e8a3b93831 Update Extended.kt 2022-08-14 22:11:55 +06:00
e10caa3171 add support of has_restricted_voice_and_video_messages 2022-08-14 21:56:25 +06:00
d4fe4e09fc add support of Bot API 6.2 in webapp parts 2022-08-14 21:52:26 +06:00
ad453afba2 start 3.1.1 2022-08-14 18:55:08 +06:00
a0daca28b1 Merge pull request #642 from InsanusMokrassar/3.1.0
3.1.0
2022-08-13 14:44:00 +06:00
cd62a9ef3c fixes 2022-08-13 14:40:00 +06:00
3c084d70e5 fix of #588 2022-08-13 13:13:07 +06:00
2611d4ecc1 fill changelog with dependnecies updates 2022-08-13 13:06:18 +06:00
b4d853dfa0 update bot api support info 2022-08-13 13:03:34 +06:00
5044075adf add support of sticker_type for new sticker sets and rework create new sticker set requests 2022-08-13 13:01:09 +06:00
5f2660b804 fill raw sticker data 2022-08-13 12:20:28 +06:00
c72dccc0f9 rework of stickers and stickersets 2022-08-13 11:58:42 +06:00
3fc1058491 start rework of stickers and stickersets 2022-08-13 00:02:48 +06:00
c3668e978b add support of custom emojis 2022-08-12 23:21:53 +06:00
5a4a6d5710 start 3.1.0 2022-08-12 22:42:47 +06:00
ed1d8beb2e Update libs.versions.toml 2022-08-12 13:28:45 +06:00
881ede7d2a start 3.0.3 2022-08-12 13:25:58 +06:00
60d3d279e7 Update gradle-wrapper.properties 2022-08-06 10:19:22 +06:00
4b84518dbb Merge pull request #637 from InsanusMokrassar/3.0.2
3.0.2
2022-08-06 00:40:46 +06:00
8b451791dd fixes 2022-08-06 00:39:46 +06:00
771fb5c288 Update build.gradle 2022-08-05 23:48:15 +06:00
d19ee74f8b Update CHANGELOG.md 2022-08-05 23:47:43 +06:00
aaf489c2ed Update gradle.properties 2022-08-05 23:47:06 +06:00
1b06b63703 update to hotfix up to 3.0.1 2022-08-05 22:49:32 +06:00
bf7fc25285 make lib dependency implementation instead of api 2022-08-05 22:30:11 +06:00
4df242747f fix dokka build 2022-08-05 22:03:10 +06:00
e831ca143e Merge pull request #634 from InsanusMokrassar/3.0.0
3.0.0
2022-08-05 21:54:31 +06:00
44838a2088 optimize imports in behaviour builder common 2022-08-05 21:44:36 +06:00
3823b03453 fixes 2022-08-05 21:43:15 +06:00
ec48708195 start to fill changelog 2022-08-05 21:27:45 +06:00
6a06775bc4 add file annotations generation to the class casts 2022-08-05 18:57:50 +06:00
bbdff0b31a rename file with new classcasts 2022-08-05 17:31:45 +06:00
cb4880bd00 optimize imports in utils 2022-08-05 16:35:07 +06:00
a18eda3db6 add generation of class casts 2022-08-05 16:31:39 +06:00
d8f6429385 solution for #636 2022-08-05 11:49:04 +06:00
be74249b67 Update README.md 2022-08-05 01:48:44 +06:00
69f658e4a8 rewrite hierarchy of forward info classes 2022-08-04 22:45:26 +06:00
8c51ca9d72 fixes in forward from public chat info 2022-08-04 22:27:40 +06:00
48c4a3156b fix of build 2022-08-04 18:15:51 +06:00
92407c9010 remove deprecations from copyMessage 2022-08-04 18:09:25 +06:00
86937cc096 remove deprecations 2022-08-04 18:01:35 +06:00
ea614b790b update serialization 2022-08-04 17:45:35 +06:00
c994332cb9 update dependencies 2022-08-04 17:18:05 +06:00
9d893ffa48 start 3.0.0 2022-08-04 17:12:34 +06:00
57d2fe85c5 Merge pull request #632 from InsanusMokrassar/2.2.2
2.2.2
2022-07-31 19:26:47 +06:00
c68b148d5e inline buildEntities 2022-07-31 18:26:07 +06:00
0a0a7cea0e fixes in callback query triggers 2022-07-31 17:49:48 +06:00
ea981605f6 start 0.2.2 2022-07-31 17:46:59 +06:00
fe1e65a83c Merge pull request #630 from InsanusMokrassar/2.2.1
2.2.1
2022-07-22 20:00:27 +06:00
c85983bd59 update microutils 2022-07-22 18:45:09 +06:00
d72e1029d3 fill changelog 2022-07-22 16:50:20 +06:00
4b89563cff fixes in classcasts, withContentOrNull and withContentOrThrow 2022-07-22 16:45:54 +06:00
542079f4bf Merge pull request #629 from d1snin/tgbotapi-627
Add content-oriented typealiases for messages
2022-07-22 16:15:02 +06:00
d1snin
5c7164e864 refactored the handlers to use new typealiases when possible 2022-07-18 11:59:01 +03:00
6329905f62 Update libs.versions.toml 2022-07-18 14:53:10 +06:00
c54945e4cc Update gradle-wrapper.properties 2022-07-18 14:52:16 +06:00
8f20e1d617 Update gradle.properties 2022-07-18 14:48:52 +06:00
d1snin
edbfedb74e added logically missing typealiases 2022-07-18 11:26:18 +03:00
d1snin
b5006cd1e0 Add content-oriented typealiases for messages 2022-07-18 11:02:13 +03:00
ca01ce7843 Merge pull request #628 from InsanusMokrassar/tg_channel_imh
Tg Channel QR
2022-07-18 13:44:04 +06:00
54fad3f338 Add files via upload 2022-07-18 13:43:06 +06:00
15ef481fd7 Update README.md 2022-07-18 13:42:17 +06:00
91e1202674 Delete 68a81ca4-7950-48df-b842-85f285ce3741.jpg 2022-07-18 13:33:23 +06:00
bdd39963a8 Add files via upload 2022-07-18 13:31:30 +06:00
01dfedf540 Merge pull request #623 from InsanusMokrassar/2.2.0
2.2.0
2022-07-11 11:18:07 +06:00
8ded892b72 new class casts 2022-07-11 02:20:28 +06:00
d0b606469b fixes related to owner chat member 2022-07-11 02:05:10 +06:00
678f79da04 CreatorChatMember -> OwnerChatMember 2022-07-11 01:56:31 +06:00
fde2c79f4c extract force_reply field into constant 2022-07-11 01:43:04 +06:00
acaf46e015 ReplyForce companion improvements 2022-07-11 01:27:28 +06:00
3f9237b5de flatInlineKeyboard and flatReplyKeyboard 2022-07-11 01:10:35 +06:00
3d7334dd62 sameChat 2022-07-11 00:57:13 +06:00
26306f1567 sameMessage 2022-07-11 00:53:20 +06:00
247553d990 add note about parameters order 2022-07-11 00:45:11 +06:00
049a8a3263 copy message order of parameters changed 2022-07-11 00:26:57 +06:00
cc67a31e97 start 2.2.0 2022-07-11 00:10:30 +06:00
8791573145 Update build.gradle 2022-07-10 00:04:36 +06:00
5752f7a4fb Merge pull request #622 from InsanusMokrassar/2.1.3
2.1.3
2022-07-09 23:54:18 +06:00
ade236eaa3 update microutils 2022-07-09 23:52:16 +06:00
e7340a483a fixes 2022-07-09 23:45:24 +06:00
c7dc69d09f ChatJoinRequest#inviteLink fix 2022-07-09 23:09:52 +06:00
c2487c5adc fixes in links 2022-07-09 22:43:19 +06:00
7c4808f163 start 2.1.3 2022-07-09 22:37:58 +06:00
b91b516659 Merge pull request #618 from InsanusMokrassar/2.1.2
2.1.2
2022-06-29 14:42:01 +06:00
57cdc4ff2a fill changelog 2022-06-29 14:27:29 +06:00
864992aff0 complete rewriting on libs.versions.toml 2022-06-29 14:23:45 +06:00
e18e8ba6df start to use more unified way of scripts organization 2022-06-29 13:47:21 +06:00
02cedc6626 start 2.1.2 2022-06-29 13:27:35 +06:00
619b890956 Merge pull request #615 from InsanusMokrassar/2.1.1
2.1.1
2022-06-26 13:42:26 +06:00
100a76a832 Update CHANGELOG.md 2022-06-26 13:36:13 +06:00
c583ae6761 replace all the edits into one file 2022-06-26 13:18:22 +06:00
7429ffb514 add TelegramBot#send extensions 2022-06-25 23:06:41 +06:00
95aeedfb94 Update DeleteMessage.kt 2022-06-25 18:34:41 +06:00
095e318a78 Update DeleteMessage.kt 2022-06-25 18:04:20 +06:00
4aa2d2ae41 Update gradle.properties 2022-06-25 03:13:46 +06:00
e936d25c13 TelegramBot#edit 2022-06-25 02:49:38 +06:00
97a2a5d9fd exists methods of editing text/caption improvements 2022-06-25 02:19:20 +06:00
00ab532eac start 2.1.1 2022-06-25 02:11:23 +06:00
c2cc6ee1ec Merge pull request #613 from InsanusMokrassar/2.1.0
2.1.0
2022-06-21 23:09:27 +06:00
d20b94e52c rename PremiumChat -> PossiblyPremiumChat 2022-06-21 23:06:36 +06:00
9f3cc6eafb add mention about 6.1 telegram bot api support 2022-06-21 18:58:01 +06:00
f86a095421 CreateInvoiceLink 2022-06-21 18:52:55 +06:00
b0c6b80d8b small improvements 2022-06-21 18:30:31 +06:00
1df653f428 SetWebhook#secretToken 2022-06-21 17:55:21 +06:00
8dfaca7648 CommonUser#addedToAttachmentMenu 2022-06-21 17:52:16 +06:00
04db76831f add support of premium fields 2022-06-21 17:34:14 +06:00
f2e9bf6bd8 update webapps support 2022-06-21 16:35:48 +06:00
cde8fdeffd start 2.1.0 2022-06-21 15:22:34 +06:00
e74f339ae2 Merge pull request #609 from InsanusMokrassar/2.0.3
2.0.3
2022-06-17 14:34:23 +06:00
ff7702486f downloadFileToTemp 2022-06-17 13:49:44 +06:00
c7818fe4df Update gradle.properties 2022-06-17 11:04:31 +06:00
8243acd69e regularln 2022-06-17 02:51:22 +06:00
8081602a39 update microutils 2022-06-17 00:20:30 +06:00
6fd85dbc56 start 2.0.3 2022-06-17 00:16:23 +06:00
8d6f4ba136 Merge pull request #602 from InsanusMokrassar/2.0.2
2.0.2
2022-06-05 21:01:10 +06:00
b95b339ad1 Update CHANGELOG.md 2022-06-05 17:40:53 +06:00
637979100b Update gradle.properties 2022-06-05 17:40:13 +06:00
4067439a13 update micro_utils 2022-06-04 21:01:40 +06:00
03583ff6c1 start 2.0.2 2022-06-04 21:00:33 +06:00
c1330f8e32 Merge pull request #598 from InsanusMokrassar/2.0.1
2.0.1
2022-05-29 23:06:15 +06:00
db36c6aacb Update CHANGELOG.md 2022-05-29 22:16:55 +06:00
757e317e70 Update gradle.properties 2022-05-29 22:15:56 +06:00
cb708a1ba4 Update CHANGELOG.md 2022-05-29 09:03:18 +06:00
551276f78e Update gradle.properties 2022-05-29 09:02:52 +06:00
88339a4977 Update CHANGELOG.md 2022-05-28 09:56:40 +06:00
a13371e14c Update gradle.properties 2022-05-28 09:55:10 +06:00
ad7fdc6211 improvements in longPolling extension 2022-05-22 22:36:56 +06:00
c870a48a22 start 2.0.1 2022-05-22 22:35:45 +06:00
3149fd0231 Merge pull request #597 from InsanusMokrassar/2.0.0
2.0.0
2022-05-22 12:58:46 +06:00
7430490499 fixes for build 2022-05-22 01:46:11 +06:00
416187e079 remove deprecations 2022-05-22 01:40:03 +06:00
e7aec75aca removing of filters for the wait triggers 2022-05-22 01:27:52 +06:00
95a466a08b start 2.0.0 2022-05-21 23:53:45 +06:00
507cb2af26 cleanup waiters in behaviour builder and add withEvent 2022-05-21 23:38:42 +06:00
126a07cdc7 start 1.2.0 2022-05-21 23:32:36 +06:00
27a24a18a6 fix of updates funnel in subsequent behaviour contexts 2022-05-21 21:44:33 +06:00
562e8c7429 improvements in Beheviour Context 2022-05-21 17:33:44 +06:00
be027efc43 start 1.1.4 2022-05-21 17:27:04 +06:00
e55195b308 Merge pull request #593 from InsanusMokrassar/1.1.3
1.1.3
2022-05-19 13:38:05 -04:00
14afb59b5f StateHandlingErrorHandler in microutils 2022-05-19 20:37:52 +06:00
6b23347d56 start 1.1.3 2022-05-19 20:24:55 +06:00
f54843fb60 Merge pull request #592 from InsanusMokrassar/1.1.2
1.1.2
2022-05-18 07:10:31 -04:00
8a3538d9c7 fixes in relate to main behaviourBuilder fun 2022-05-18 17:05:47 +06:00
e3db4250bb add default copy realization in BehaviourContextWithFSM 2022-05-18 16:52:52 +06:00
4643ac906a StateHandlingErrorHandler 2022-05-18 16:45:08 +06:00
497974e45c fix of #591 2022-05-18 16:31:14 +06:00
78a00f0efb start 1.1.2 2022-05-18 16:27:30 +06:00
14ecb9d948 Merge pull request #590 from InsanusMokrassar/1.1.1
1.1.1
2022-05-17 09:56:47 -04:00
c759b9a466 deprecate hmac and hex extensions for CryptoJS in webapp 2022-05-17 19:54:13 +06:00
58c1f2ee6a fixes in TelegramAPIUrlsKeeper#checkWebAppLink 2022-05-17 19:51:14 +06:00
9d16ca3b7e small refactor of buildBehaviourWithLongPolling 2022-05-16 18:59:30 +06:00
9d40e598f1 buildBehaciour returns BehaviourContext 2022-05-16 18:58:19 +06:00
f1be8bf16e start 1.1.1 2022-05-16 18:53:15 +06:00
56a8804e99 Merge pull request #589 from InsanusMokrassar/1.1.0
1.1.0
2022-05-14 12:21:08 +06:00
1e73aac750 Update Webhook.kt 2022-05-14 02:32:39 +06:00
82c6eda0b7 Update Webhook.kt 2022-05-14 02:31:36 +06:00
e9ff93cde1 improvements in webhooks 2022-05-14 01:35:38 +06:00
9b179ea1c9 start 1.1.0 2022-05-14 00:06:32 +06:00
72d20d2344 Merge pull request #586 from InsanusMokrassar/1.0.1
1.0.1
2022-05-13 00:52:50 +06:00
bcd288fe05 update dependencies 2022-05-12 17:51:42 +06:00
75477060e9 start 1.0.1 2022-05-12 17:50:04 +06:00
60df609486 Merge pull request #564 from InsanusMokrassar/1.0.0
1.0.0
2022-05-12 00:05:05 +06:00
556b492b35 remove redundant changelog part 2022-05-11 19:54:33 +06:00
53e8c53fb1 extract ReplyKeyboardMarkup fields names to the constants 2022-05-11 12:08:20 +06:00
69d36c5c1b a little refactor 2022-05-11 11:04:21 +06:00
ad97008f12 refactoring and fixes 2022-05-11 10:56:31 +06:00
3e58114eeb Update BehaviourWithFSMStateHandlerHolder.kt 2022-05-11 10:30:47 +06:00
d55d8fa000 fixes in behaviour builders 2022-05-11 02:47:00 +06:00
bd32dbb3ab update dependencies note in changelog 2022-05-10 23:59:40 +06:00
8e0389f032 update microutils 2022-05-10 23:53:05 +06:00
cb37b85234 update previews 2022-05-09 02:27:06 +06:00
df01976ea8 fix of build 2022-05-08 00:39:41 +06:00
7be74e468b Merge branch 'master' into 1.0.0 2022-05-08 00:38:05 +06:00
437176203a Merge pull request #584 from InsanusMokrassar/0.38.23
0.38.23
2022-05-08 00:33:27 +06:00
7b25862035 optimize imports 2022-05-08 00:30:47 +06:00
45585caab0 fix of #560 2022-05-08 00:28:00 +06:00
6fea2a12d8 start 0.38.23 2022-05-07 23:26:26 +06:00
ae639d38e0 Merge branch 'master' into 1.0.0 2022-05-05 14:58:07 +06:00
0510f72859 Merge pull request #583 from InsanusMokrassar/0.38.22
0.38.22
2022-05-05 14:33:59 +06:00
233c789054 improvements in keyboards and add tgWebAppStartParamField 2022-05-04 23:11:20 +06:00
52f405c3b1 start 0.38.22 2022-05-04 23:10:31 +06:00
199856acce Merge pull request #581 from InsanusMokrassar/0.38.21
0.38.21
2022-05-04 13:35:08 +06:00
f36d642ec8 sendDataOrWorkWithQueryId 2022-05-04 13:05:54 +06:00
aa6e5b2284 fix of WebAppInitData#queryId js name 2022-05-04 12:58:06 +06:00
32b83ac687 start 0.38.21 2022-05-04 12:51:14 +06:00
a2206b99a2 Merge branch 'master' into 1.0.0 2022-05-04 11:13:17 +06:00
90e0b1ac81 Merge pull request #580 from InsanusMokrassar/0.38.20
0.38.20
2022-05-04 11:11:53 +06:00
1b5b3af45b add handleResult 2022-05-04 11:01:48 +06:00
7ff6412ec5 TelegramBot#answerWebAppQuery 2022-05-04 10:51:38 +06:00
bd23d3fbdb hotfixes 2022-05-03 23:12:03 +06:00
08147fc33b start 0.38.20 2022-05-03 23:11:02 +06:00
ba4c153659 Merge pull request #579 from InsanusMokrassar/0.38.19
0.38.19
2022-05-03 14:36:22 +06:00
3c3607d817 fill changelog 2022-05-03 14:32:29 +06:00
d0add888c4 now the handlers from the upstream lists are not modified in the whole fsm behaviour context 2022-05-03 14:28:03 +06:00
3e3adab46b complete fix of issue with subcontexts 2022-05-03 13:58:13 +06:00
89d13de307 deprecation of BehaviourContextWithFSMBuilder 2022-05-03 10:38:48 +06:00
32451f4e1c start 0.38.19 2022-05-03 09:44:39 +06:00
721c3f2430 fix after merge 2022-05-02 14:19:56 +06:00
fc92df8fbe Merge branch 'master' into 1.0.0 2022-05-02 13:50:31 +06:00
ad50f41d1e Merge pull request #578 from InsanusMokrassar/0.38.18
0.38.18
2022-05-02 13:49:24 +06:00
8c9cd9df67 fix of #577 2022-05-02 13:21:43 +06:00
8e7f7a03c8 note about xzima help 2022-05-02 12:44:20 +06:00
484e09374d small refactor 2022-05-02 12:29:30 +06:00
Alex
619c82bb32 fix: new BehaviourContext ignored 2022-05-02 12:29:21 +06:00
33fb75a5eb start 0.38.18 2022-05-02 12:28:39 +06:00
901c1e8956 Merge pull request #576 from xzima/fix_new_BehaviourContext_ignored
fix: new BehaviourContext ignored
2022-05-02 08:50:20 +06:00
2ae105cb15 small refactor 2022-05-02 08:49:58 +06:00
Alex
db14eee3b6 fix: new BehaviourContext ignored 2022-05-02 01:16:24 +03:00
6f8b881668 replaces of CommonAbstracts 2022-05-01 22:13:40 +06:00
d113d4f0f5 replace ReplyMarkups and api extensions for live locations 2022-05-01 21:33:36 +06:00
dd893b14d3 replaces of live location editing requests 2022-05-01 21:20:31 +06:00
19ddff2999 MediaGroupUpdates replaces 2022-05-01 21:01:03 +06:00
7f08fd9d66 replace ParseMode 2022-05-01 20:43:03 +06:00
d3cb44490b TextSources replacements 2022-05-01 20:36:07 +06:00
4d3cad16a4 Merge branch 'master' into 1.0.0 2022-05-01 17:26:21 +06:00
a52f31f4c9 Merge pull request #575 from InsanusMokrassar/0.38.17
0.38.17
2022-05-01 17:23:33 +06:00
682f696866 fill changelog 2022-05-01 17:23:12 +06:00
87fff2e5d0 add BotCommandScope helper extensions 2022-05-01 17:18:44 +06:00
92b4ba2ff0 fix of #574 2022-05-01 16:50:03 +06:00
9014cdbc99 start 0.38.17 2022-05-01 16:41:47 +06:00
d0709a509f cleanup in message contents 2022-05-01 11:52:02 +06:00
0273d07777 update ktor 2022-05-01 11:22:23 +06:00
bafb0c2459 fix incosistences after updating of dependencies 2022-05-01 11:21:01 +06:00
9be2b899cb Merge branch 'master' into 1.0.0 2022-05-01 11:07:22 +06:00
37317a1055 Merge pull request #573 from InsanusMokrassar/0.38.16
0.38.16
2022-04-29 23:28:12 +06:00
60c21002e1 fixes 2022-04-29 19:50:02 +06:00
78a7a3546a remove checking of webapp data from webapp module due to its existing in core 2022-04-29 19:18:22 +06:00
4799617ced "TelegramAPIUrlsKeeper" now have two new things: properties "webAppDataSecretKey" and fun "checkWebAppLink" 2022-04-29 19:11:38 +06:00
c70484076d start 0.38.16 2022-04-29 18:56:38 +06:00
9f451f25f7 update dependencies 2022-04-28 10:40:44 +06:00
506c2b4a09 Merge branch 'master' into 1.0.0 2022-04-26 15:20:59 +06:00
0c92e6eeb4 Merge pull request #570 from InsanusMokrassar/0.38.15
0.38.15
2022-04-26 13:45:09 +06:00
efd1c8f83a add additional onDataCallbackQuery variants with regex filters 2022-04-26 13:22:00 +06:00
7e57a0e4e0 revert update of microutils version 2022-04-26 13:07:16 +06:00
6b977e67d0 Revert "add telegram update handler"
This reverts commit ab5937449c.
2022-04-26 13:05:56 +06:00
ab5937449c add telegram update handler 2022-04-25 22:28:35 +06:00
61d3131bf2 update micro_utils 2022-04-25 21:58:25 +06:00
048f244449 update microutils 2022-04-25 21:19:49 +06:00
6ebf4ff652 fixes in MessageContent#serializationModule 2022-04-25 21:19:08 +06:00
b4c41d7dd8 start 0.38.15 2022-04-24 18:39:07 +06:00
6cbe313e42 Merge branch 'master' into 1.0.0 2022-04-23 12:50:12 +06:00
930507ab80 Merge pull request #568 from InsanusMokrassar/0.38.14
0.38.14
2022-04-23 12:43:02 +06:00
56d3628dd3 add support of menu buttons 2022-04-23 12:39:14 +06:00
56d7853f68 update defaults in telegramBot factories 2022-04-23 12:34:38 +06:00
0a27d9bf28 add shortcuts for telegram and webApp in webapps 2022-04-23 12:34:26 +06:00
c74df3960c fixes in viewport changed events 2022-04-23 12:34:13 +06:00
f4b080cb45 now WebAppData is data class 2022-04-23 12:34:05 +06:00
350b77f6ff add webAppButton overload with url as string 2022-04-23 12:33:56 +06:00
955e14f67c add trigger and expectation for WebAppData 2022-04-23 12:33:45 +06:00
ae88b7d94d fix dokka 2022-04-23 12:33:34 +06:00
88c62bd51c add checking of data in web app 2022-04-23 12:33:23 +06:00
705bcbe352 webapps 2022-04-23 12:32:39 +06:00
ffcc149c40 update info about supported telegram bot api version 2022-04-23 12:31:37 +06:00
402d91f9f2 add support of SentWebAppMessage 2022-04-23 12:31:22 +06:00
c19bccc7d1 add support of WebAppInfo 2022-04-23 12:30:35 +06:00
2c71377058 voice(_c/C)hat* -> video(_c/C)hat* renames 2022-04-23 12:30:15 +06:00
12d2c05110 add support of WebhookInfo#lastSynchronizationErrorDate 2022-04-23 12:28:40 +06:00
ddf46c1afd add support of ChatAdministratorRights 2022-04-23 12:27:24 +06:00
dd0a8b99c7 add WebAppData 2022-04-23 12:26:28 +06:00
75fb72936f fix of 563 2022-04-23 12:25:39 +06:00
1a6a010446 start 0.38.14 2022-04-23 12:24:52 +06:00
900ef28404 rename InputMedia -> TelegramMedia and replace all InputMedia to media package 2022-04-22 13:54:06 +06:00
a930423955 chats sealing 2022-04-22 00:16:41 +06:00
323c4de858 replace of ChatMember 2022-04-21 23:24:01 +06:00
cdd5649c04 CallbackQuery package -> queries.callback 2022-04-21 22:42:54 +06:00
2275a61d73 deprecation of dev.inmo.tgbotapi.bot.Ktor 2022-04-21 21:57:11 +06:00
bf8f4c75f8 update defaults in telegramBot factories 2022-04-21 21:48:25 +06:00
b5334c2b72 fix of #556 2022-04-21 17:54:21 +06:00
8331d4edd7 fix of #546 2022-04-21 15:42:32 +06:00
0e6a708eea add shortcuts for telegram and webApp in webapps 2022-04-21 14:49:52 +06:00
fbc5e9f8c4 fixes in viewport changed events 2022-04-21 14:49:52 +06:00
040a996df6 now WebAppData is data class 2022-04-21 14:49:52 +06:00
cf27600fb5 add webAppButton overload with url as string 2022-04-21 14:49:52 +06:00
1d42f86623 add trigger and expectation for WebAppData 2022-04-21 14:49:52 +06:00
a9cb07fa0d fix dokka 2022-04-21 14:49:52 +06:00
dd7567f43c add checking of data in web app 2022-04-21 14:49:52 +06:00
d0006bb089 webapps 2022-04-21 14:49:52 +06:00
7d8b990ec4 remove tgbotapi.extensions.* 2022-04-21 14:49:52 +06:00
4d20e2cd1c update info about supported telegram bot api version 2022-04-21 14:49:52 +06:00
4ffe6f915f add support of SentWebAppMessage 2022-04-21 14:49:52 +06:00
22a7697447 add support of WebAppInfo 2022-04-21 14:49:52 +06:00
ef9941134e voice(_c/C)hat* -> video(_c/C)hat* renames 2022-04-21 14:49:52 +06:00
ba85b8657d add support of WebhookInfo#lastSynchronizationErrorDate 2022-04-21 14:49:52 +06:00
2dcbc0df32 add support of ChatAdministratorRights 2022-04-21 14:49:52 +06:00
7bac4a3a32 add support of menu buttons 2022-04-21 14:49:52 +06:00
63bcc4bcf8 add WebAppData 2022-04-21 14:49:52 +06:00
643f8e577e fix of #550 2022-04-21 14:49:52 +06:00
721b82f912 fix of 563 2022-04-21 14:49:52 +06:00
892aef738d start 1.0.0 🎉 2022-04-21 14:49:52 +06:00
4c7bfe99c0 Merge pull request #567 from InsanusMokrassar/renovate/github_release_plugin_version
Update dependency com.github.breadmoirai:github-release to v2.3.7
2022-04-20 20:13:28 +06:00
Renovate Bot
1e4b8d405e Update dependency com.github.breadmoirai:github-release to v2.3.7 2022-04-19 00:27:10 +00:00
007112e67a Merge pull request #559 from InsanusMokrassar/0.38.13
0.38.13
2022-04-17 00:26:23 +06:00
a87c21273d BehaviourContext#on*Message extensions 2022-04-17 00:22:00 +06:00
ff2d1615da replace TODO for pipelineStepsHolder with default realization 2022-04-16 23:58:24 +06:00
08ef146daa Update gradle.properties 2022-04-13 23:12:32 +06:00
a404a6c59c fixes in DownloadFIleChannelRequestCallFactory 2022-04-11 21:56:47 +06:00
1089c716f3 deprecate StorageFileInfo 2022-04-11 21:00:56 +06:00
81ad55b19f add KtorPipelineStepsHolder#onRequestReturnResult 2022-04-11 14:41:02 +06:00
863c872f35 start to add pipelines and fix mention creation 2022-04-11 12:46:33 +06:00
ece6a917ed start 0.38.13 2022-04-11 11:59:37 +06:00
12248aa702 Merge pull request #555 from InsanusMokrassar/0.38.12
0.38.12
2022-04-09 12:24:57 +06:00
83ea4f6435 Update gradle.properties 2022-04-08 09:49:06 +06:00
52204d8df1 Experemtally update kotlin 2022-04-08 09:44:37 +06:00
81b9ccdf6a Update VideoContent.kt 2022-04-08 09:29:07 +06:00
fa74f12505 Update CHANGELOG.md 2022-04-08 02:09:22 +06:00
be284c4d96 Update dependencies 2022-04-08 02:08:21 +06:00
1769fcacfd update gradle 2022-04-06 11:45:08 +06:00
4207d89c92 accumulated updates improvements 2022-04-04 13:16:18 +06:00
87ee2f280b remove redundant TextedMediaInputMediaContent 2022-04-03 19:56:34 +06:00
3d458b2dc6 fixes in builds and filling up functionality related to new classes 2022-04-03 19:48:48 +06:00
ee1c7c6533 TextedMediaGroupMediaInput 2022-04-03 19:37:56 +06:00
97d122c770 TextedMediaContent fixes 2022-04-03 19:29:48 +06:00
49da0faf45 replies with texted content 2022-04-03 19:21:38 +06:00
d426cb1210 TextedMediaContent 2022-04-03 19:06:27 +06:00
af83ac79e7 start 0.38.12 2022-04-03 18:35:17 +06:00
602f15c206 Update README.md 2022-04-01 00:01:25 +06:00
c2f40534e6 Update README.md 2022-03-31 23:55:34 +06:00
5693d4d808 Merge pull request #548 from InsanusMokrassar/0.38.11
0.38.11
2022-03-29 23:40:04 +06:00
9fe55aa6ef Update CHANGELOG.md 2022-03-29 12:42:02 +06:00
8f817f1492 reply with any media file 2022-03-29 12:37:54 +06:00
0fd146655d old matrix and row deprecation 2022-03-29 12:27:03 +06:00
94e5f74a90 reply with content 2022-03-29 12:20:52 +06:00
b9bffbb71b update dependencies 2022-03-27 13:47:38 +06:00
5ec5c3bdfd Fixes in "TextSourcesList" creating in from "RawMessageEntities" 2022-03-27 13:44:41 +06:00
a5ed2a82bb start 0.38.11 2022-03-27 13:36:21 +06:00
1b7dd11e75 Merge pull request #545 from InsanusMokrassar/0.38.10
0.38.10
2022-03-25 10:36:21 +06:00
8d0307fb7f update github building yml 2022-03-24 16:49:08 +06:00
c500f0a281 update reply and sendPhoto with PhotoSize 2022-03-24 16:47:07 +06:00
b3abeaa5ae Update packages_publishing.yml 2022-03-23 17:03:08 +06:00
8930a66134 with*Action block called once 2022-03-23 11:48:20 +06:00
76a2a2ca74 start 0.38.10 2022-03-23 05:06:48 +06:00
7dff8af460 Update gradle.properties 2022-03-23 05:01:09 +06:00
5261ab1cf0 start 0.38.10 2022-03-23 05:00:28 +06:00
f45c653fca Merge pull request #544 from InsanusMokrassar/0.38.9
0.38.9
2022-03-22 19:06:29 +06:00
5e03098ca8 fill changelog 2022-03-22 19:06:02 +06:00
2a3d8e6e73 publication scripts update 2022-03-22 16:26:18 +06:00
8c3dac7932 signature clashes fixes 2022-03-21 23:23:19 +06:00
83fb7f7bcb add opportunity to use several bots in one to serve bots requests 2022-03-21 23:06:23 +06:00
459414e7dd add RistFeature to SerializationModule 2022-03-21 17:03:37 +06:00
508d51f5a9 reply with copyMessage 2022-03-20 12:14:26 +06:00
36f22579b2 add MessageContent.Companion#serializationModule 2022-03-20 11:52:29 +06:00
d3d5f7f2e6 start 0.38.9 2022-03-20 11:50:52 +06:00
1369680419 Merge pull request #543 from InsanusMokrassar/0.38.8
0.38.8
2022-03-19 21:15:03 +06:00
f6e819be62 simpleFilter to list wrapper 2022-03-19 12:49:14 +06:00
553da0a3ee update dependencies and fill changelog 2022-03-19 12:27:46 +06:00
bace2724da a little bit refactor MediaGroupTriggers.kt 2022-03-19 10:15:44 +06:00
be710612b5 Update MediaGroupTriggers.kt 2022-03-19 09:55:48 +06:00
ea19c10f41 start 0.38.8 2022-03-18 19:18:34 +06:00
1b88881c62 Update README.md 2022-03-14 02:50:38 +06:00
be62c4fe37 Merge pull request #540 from InsanusMokrassar/0.38.7
0.38.7
2022-03-12 14:32:20 +06:00
d3499cdde1 update microutils and fill changelog 2022-03-12 13:41:49 +06:00
01d04f9d2b Update gradle-wrapper.properties 2022-03-11 22:31:19 +06:00
d290992e40 Update gradle.properties 2022-03-11 22:30:52 +06:00
867bdb8bd7 Update CHANGELOG.md 2022-03-08 00:18:25 +06:00
5f0a67187f add default votes in SimplePollOption 2022-03-08 00:15:29 +06:00
d9638849e2 update dependencies 2022-03-07 12:44:55 +06:00
5568720b5b start 0.38.7 2022-03-07 12:44:08 +06:00
c0c591fe08 Merge pull request #535 from InsanusMokrassar/0.38.6
0.38.6
2022-02-27 22:22:04 +06:00
3c1f8421c9 Update CHANGELOG.md 2022-02-27 10:04:28 +06:00
35b20d102c Update gradle.properties 2022-02-26 22:01:41 +06:00
70e6dc8fc9 update dependencies 2022-02-19 23:07:30 +06:00
4f0de376ab MentionTextSource#username 2022-02-19 23:02:58 +06:00
10c52c695c start 0.38.6 2022-02-19 22:54:41 +06:00
2d2c745527 Merge pull request #532 from InsanusMokrassar/0.38.5
0.38.5
2022-02-08 16:53:27 +06:00
1238843bde update dependencies 2022-02-08 16:50:38 +06:00
1ebaa1c387 deeplinking fixes and additions 2022-02-07 18:08:06 +06:00
b2bc47ec04 start 0.38.5 2022-02-07 18:00:13 +06:00
514620b2bd Merge pull request #530 from InsanusMokrassar/0.38.4
0.38.4
2022-02-02 10:05:11 +06:00
054f06e18b Update gradle.properties 2022-02-01 23:39:07 +06:00
00d467d091 classcasts and raw fields updates 2022-02-01 23:25:22 +06:00
6426ed6571 fixes 2022-02-01 23:05:47 +06:00
fba6707f44 fixes in create sticker set methods 2022-02-01 17:59:23 +06:00
0c2fe6bce7 support of Telegram Bot API 5.7 2022-02-01 16:23:26 +06:00
eee9fe439f fix of #529 2022-01-31 17:52:01 +06:00
3547c09383 start 0.38.4 2022-01-31 17:48:10 +06:00
956f02d26d Merge pull request #526 from InsanusMokrassar/0.38.3
0.38.3
2022-01-14 16:47:49 +06:00
468fc0a49b Update CHANGELOG.md 2022-01-14 16:31:57 +06:00
441f3cee3d Update gradle.properties 2022-01-14 16:31:19 +06:00
1ea79b9f7f update changelog 2022-01-13 19:01:17 +06:00
094f88867d Update gradle.properties 2022-01-13 13:52:49 +06:00
85a8a8eedc update dokka version 2022-01-12 13:02:23 +06:00
28fce0b4c1 New extensions "TelegramBot#send*" for media groups with contents 2022-01-12 11:39:35 +06:00
2f5fdcdca0 start 0.38.3 2022-01-12 11:37:34 +06:00
21799d7e4a add exceptions handling readme 2022-01-11 21:22:10 +06:00
ca409db0ee Merge pull request #525 from InsanusMokrassar/0.38.2
0.38.2
2022-01-10 23:08:50 +06:00
33c8ee0803 remove redundant copyMessage 2022-01-10 13:48:00 +06:00
0c0ec22348 update microutils dependency 2022-01-10 13:16:50 +06:00
24bffbbd97 addopportunity to copy messages using just content 2022-01-10 13:15:10 +06:00
a615d1c4fd copyMessages for media groups 2022-01-10 13:06:18 +06:00
a76b7977b3 start 0.38.2 2022-01-10 12:38:48 +06:00
6004879aef Merge pull request #524 from InsanusMokrassar/0.38.1
0.38.1
2022-01-07 13:37:06 +06:00
98ff2558e9 remove redundant dependency in utils 2022-01-07 13:32:34 +06:00
61c00b38b1 Update core publish scripts 2022-01-07 13:29:53 +06:00
2096671147 upfill raw extensions 2022-01-07 12:56:42 +06:00
094d58f59f upfill of changelog 2022-01-06 17:13:37 +06:00
578a66b758 fill changelog 2022-01-06 17:00:56 +06:00
b5bb40576b optimize imports of utils 2022-01-06 16:59:15 +06:00
953638ddf5 add raw fields for CallbackQuery 2022-01-06 16:57:51 +06:00
1c9ca7a493 add raw fields for ChosenInlineResult 2022-01-06 16:52:28 +06:00
c220412b02 add raw fields for InlineQuery 2022-01-06 16:45:50 +06:00
41852dde7c add raw fields for polls 2022-01-06 16:42:19 +06:00
3150cd6a37 fix build 2022-01-06 14:55:07 +06:00
07de18efd8 update changelog 2022-01-06 14:50:14 +06:00
9552550198 UserLoggedIn, additions in ClassCasts and partial fix of #511 2022-01-06 14:49:11 +06:00
e1c94f772d MessageCallbackQuery#message now is ContentMessage<MessageContent> 2022-01-06 13:54:22 +06:00
fbed81a1b3 start 0.38.1 2022-01-06 13:49:03 +06:00
b61912d99a Merge pull request #522 from InsanusMokrassar/0.38.0
0.38.0
2022-01-02 03:34:45 +06:00
5efe74171d Update README.md 2022-01-02 03:33:52 +06:00
393981560c Update README.md 2022-01-02 03:32:59 +06:00
73b355df55 fixes 2022-01-02 02:00:22 +06:00
86885e7698 updates in CommonMessage implementers and removing of deprecations 2022-01-02 01:49:14 +06:00
4d9be1a995 fix in MessageAutoDeleteTimerChanged 2022-01-02 01:12:41 +06:00
596176ee93 simple rewrite of spoiler markdown 2022-01-01 20:20:48 +06:00
2348434048 add support of protect_content in forwardMessage 2022-01-01 20:16:07 +06:00
5c6a430f38 support of protect_content 2022-01-01 20:13:22 +06:00
148791ad68 extend InlineQueryResultGif fun with FileId and add ProtectContent + extend SendMessageRequest with it in advance 2022-01-01 13:42:39 +06:00
5c5a19c91a add spoiler support 2021-12-31 13:48:51 +06:00
bd60c4f411 update gradle wrapper 2021-12-31 12:34:01 +06:00
e5a36225f8 Merge branch 'master' into 0.38.0 2021-12-31 02:55:54 +06:00
bd2c13c178 Merge pull request #515 from InsanusMokrassar/0.37.4
0.37.4
2021-12-30 23:06:15 +06:00
6f1f94299b fix of build 2021-12-30 12:30:09 +06:00
72b8231eab update gitignore and dokka version 2021-12-30 11:55:12 +06:00
323e5fb391 update dependencies 2021-12-30 11:50:58 +06:00
dca5bb40e3 Update MigratedToSupergroup.kt 2021-12-27 23:06:51 +06:00
c21975a150 Merge branch 'master' into 0.37.4 2021-12-27 23:01:45 +06:00
8675833b99 Update CHANGELOG.md 2021-12-27 22:50:09 +06:00
faf669c035 Update gradle.properties 2021-12-27 22:48:21 +06:00
2f3a683fa0 Update CHANGELOG.md 2021-12-23 17:24:13 +06:00
2a617b5c4d Merge pull request #514 from madhead/feature/MigratedToSupergroup
Support for "migrated to supergroup" events
2021-12-22 09:47:21 +06:00
madhead
aa1e7eea1d Support for "migrated to supergroup" events 2021-12-22 02:37:43 +01:00
22eac5414c start 0.37.4 2021-12-21 19:13:49 +06:00
8206aefbb6 Merge pull request #513 from InsanusMokrassar/0.37.3
0.37.3: hotfix of 0.37.2
2021-12-20 14:11:48 +06:00
fb8cfed382 hotfix 2021-12-20 14:07:45 +06:00
2de22a08a3 Merge pull request #506 from InsanusMokrassar/0.37.2
0.37.2
2021-12-20 13:00:07 +06:00
e8022a2ded add kdocs to the requests 2021-12-20 12:50:06 +06:00
d6cef5984b filling of changelog and several fixes 2021-12-20 12:47:55 +06:00
49bea1bcef update gradle wrapper 2021-12-20 12:32:21 +06:00
85a4459072 Update RawMessage.kt 2021-12-19 00:46:06 +06:00
ce74631580 actualizing of readmes 2021-12-18 23:19:05 +06:00
1e5ce6bb5c add ContentMessage#hasProtectedContent 2021-12-18 23:12:12 +06:00
dc89e914a1 support of has_protected_content field 2021-12-18 23:11:28 +06:00
ee815c7335 update micro_utils 2021-12-18 22:29:25 +06:00
69f4033807 add support of is_automatic_forward 2021-12-18 22:28:01 +06:00
0581587adf add support of has_private_forwards 2021-12-10 12:53:00 +06:00
23f93075a4 update microutils and add banChatSenderChat and unbanChatSenderChat support 2021-12-10 12:49:13 +06:00
6c3425d5f9 Update CHANGELOG.md 2021-12-04 21:23:34 +06:00
d285590348 Update gradle-wrapper.properties 2021-12-04 21:12:12 +06:00
2e0ad6dd3c Merge pull request #505 from InsanusMokrassar/fix/linkln
Fix of linkln
2021-12-04 21:08:46 +06:00
96a5e55894 Merge pull request #499 from InsanusMokrassar/renovate/micro_utils_version
Update micro_utils_version to v0.8.5
2021-12-04 21:08:06 +06:00
4e3b085cdb start 0.37.2 2021-12-04 21:07:00 +06:00
8baa601af7 Fix of linkln 2021-12-04 12:51:55 +06:00
Renovate Bot
facd732fa8 Update micro_utils_version to v0.8.5 2021-11-27 17:38:58 +00:00
e19561367e Merge pull request #500 from InsanusMokrassar/0.37.1
0.37.1
2021-11-14 20:03:57 +06:00
249efeee7e update scripts 2021-11-14 19:42:03 +06:00
b8cc2421b6 update dependencies 2021-11-14 19:15:09 +06:00
2fa1a064ec start 0.37.1 2021-11-14 19:14:06 +06:00
63e864741e update changelog and several kdocs 2021-11-11 12:24:10 +06:00
e4f35c0eba update KDocs 2021-11-11 12:11:58 +06:00
944fe6d820 Update CHANGELOG.md 2021-11-11 11:14:05 +06:00
8ea50f36aa Merge pull request #493 from InsanusMokrassar/0.37.0
0.37.0
2021-11-10 14:48:53 +06:00
17308a6d99 update gradle distro 2021-11-10 13:06:43 +06:00
6eabea2529 Update CHANGELOG.md 2021-11-09 19:23:41 +06:00
ffe9166fee Update gradle.properties 2021-11-09 19:23:27 +06:00
f1be3e2819 Update README.md 2021-11-09 14:09:20 +06:00
c4c016c438 update common readme 2021-11-09 13:40:38 +06:00
a85e7d7387 fixes 2021-11-09 00:32:04 +06:00
fc59ab0cdd add class casts for ChatInviteLink 2021-11-08 19:15:58 +06:00
9ed7ded967 fix texts of bot actions 2021-11-08 19:07:02 +06:00
a76a7ae630 add choose_sticker 2021-11-08 18:36:17 +06:00
4715eb424f add support of join request approving/declining 2021-11-08 18:33:24 +06:00
c24d536d4c add ChatJoinRequest 2021-11-08 18:21:55 +06:00
c969d88bf0 update invite links and add name field 2021-11-08 18:00:43 +06:00
44e9dc9253 remove deprecations 2021-11-08 17:33:02 +06:00
10c62bf2c7 chat invite links update 2021-11-08 17:27:15 +06:00
20b1645935 start migrate fsm part 2021-11-06 21:21:49 +06:00
c5bf9ab1a2 Update CHANGELOG.md 2021-11-05 22:04:55 +06:00
cd6d108a9a Update gradle.properties 2021-11-05 22:03:42 +06:00
5369a85faa update dependencies 2021-11-03 17:31:24 +06:00
45a895f32f start 0.36.2 2021-11-03 17:29:10 +06:00
8c1d7203d2 Merge pull request #487 from InsanusMokrassar/0.36.1
0.36.1
2021-10-23 23:08:09 +06:00
7394a6e94b update microutils 2021-10-23 14:36:13 +06:00
a962838012 Merge pull request #488 from Djaler/get-my-commands-overload
fix getMyCommands overloads conflict when no arguments provided
2021-10-23 10:31:13 +06:00
Kirill Romanov
a5cc80a1eb fix getMyCommands overloads conflict when no arguments provided 2021-10-22 21:34:04 +03:00
064b6222e6 Merge pull request #486 from Djaler/build-entities-separator
Build entities separator
2021-10-23 00:05:28 +06:00
Kirill Romanov
8d97057d2c add separator parameter to buildEntities 2021-10-22 20:59:49 +03:00
Kirill Romanov
78f006e280 move entitiesList from EntitiesBuilder constructor 2021-10-22 20:55:10 +03:00
db956a803c Update CHANGELOG.md 2021-10-22 23:51:47 +06:00
aeb131b2f4 Update gradle.properties 2021-10-22 23:51:13 +06:00
6d80c2bddc Update README.md 2021-10-20 22:14:34 +06:00
6e32d4e863 update behaviour builder fsm readme 2021-10-18 20:08:55 +06:00
6b62070447 Merge pull request #474 from InsanusMokrassar/0.36.0
0.36.0
2021-10-18 17:13:30 +06:00
ad8710db92 add telegraph note 2021-10-18 16:43:37 +06:00
f385101e22 deprecate several behaviour builder methods 2021-10-18 15:48:24 +06:00
15386a63f9 small fix 2021-10-18 15:38:42 +06:00
576b25190a cleanup 'extension' suffix in readmes 2021-10-18 15:37:10 +06:00
dd979d8626 update publish scripts of old packages 2021-10-18 15:23:43 +06:00
e60eb68b67 packages update 2021-10-18 15:20:25 +06:00
91212eaa3a resolution of #484 2021-10-18 14:45:57 +06:00
65c1f018ac update microutils 2021-10-18 14:13:22 +06:00
5b13d3dded Merge pull request #485 from madhead/feature/possibly-reply-casts
PossiblyReplyMessage casts
2021-10-18 14:12:20 +06:00
madhead
2447d3e51f Don't run the labeler if the actor is not repo owner 2021-10-17 14:44:22 +02:00
Siarhei
4203a0fdfe PossiblyReplyMessage casts
Add asPossiblyReplyMessage / requirePossiblyReplyMessage / whenPossiblyReplyMessage
2021-10-17 14:33:14 +02:00
ddd32a81c0 Update CHANGELOG.md 2021-10-16 08:54:53 +06:00
db7a42fa9b Update gradle.properties 2021-10-16 08:54:36 +06:00
5e2df1cb4a a little fill of Readme for fsm behaviour builder 2021-10-15 18:24:06 +06:00
21c0e375f5 update kdocs of BehaviourContextWithFSM 2021-10-15 17:55:13 +06:00
4ac01d0104 update onSuccessPayment kdocs 2021-10-15 17:40:32 +06:00
9c15410c4e update kdoc of telegramBotWithBehaviourAndFSMAndStartLongPolling 2021-10-15 17:37:14 +06:00
c5ff0dbc54 fixes 2021-10-15 17:13:03 +06:00
19d221fc29 fixes 2021-10-15 16:37:20 +06:00
179a724d20 several actualizations for behaviour builder with fsm 2021-10-15 16:28:17 +06:00
ad9bc36f8c all triggers in behaviour builder now use accumulator flow 2021-10-14 23:05:11 +06:00
5a192b00d4 refactor of contentConverter 2021-10-14 22:57:04 +06:00
2a33b22afb BehaviourBuilder FSM extension 2021-10-13 14:22:01 +06:00
db1e01688d Update FUNDING.yml 2021-10-05 23:52:03 +06:00
22e71354dd update dokka 2021-10-05 17:27:50 +06:00
2e560db865 update microutils 2021-10-05 17:08:19 +06:00
016fc81b71 update microutils 2021-10-04 15:56:30 +06:00
b6e72c2399 rename poll updates triggers and fill changelog 2021-10-03 21:16:31 +06:00
e1e2b93269 deprecate waitEditedPoll and rename poll updates waiters 2021-10-03 21:14:28 +06:00
834e31906a deprecate onEditPoll and rename poll updates triggers 2021-10-03 21:12:17 +06:00
5831cc6d37 hotfix for autorenames -.- 2021-10-03 20:40:42 +06:00
0cce72de8d cover all updates in behaviour builder 2021-10-03 20:37:14 +06:00
3919359f79 CommonGroupEvent -> PublicChatEvent 2021-10-03 18:44:29 +06:00
e51a4b7702 SuccessfulPaymentEvent 2021-10-03 11:53:54 +06:00
702c1bc1ff fix build 2021-10-02 00:52:29 +06:00
6557e8af10 upfixes in changelog 2021-10-01 20:07:14 +06:00
edcebb03c0 add note about deprecation of PayInlineKeyboardButton 2021-10-01 19:57:03 +06:00
9a3fc19992 update packages_publish workflow 2021-10-01 19:42:12 +06:00
7f9faa69c8 new dsls for keyboards #472 2021-10-01 19:38:51 +06:00
5b98c5f821 update dependencies 2021-10-01 16:40:04 +06:00
40bd8d0987 update dependencies 2021-10-01 15:46:07 +06:00
2aa6497374 start 0.36.0 2021-10-01 15:45:37 +06:00
b9cb7b62fa setup toolchain for java targets 2021-09-23 13:15:44 +06:00
04679beb52 Update packages_publishing.yml 2021-09-22 20:15:48 +06:00
64e9289afb Delete build.yml 2021-09-22 20:14:58 +06:00
d4f24ee0cd Merge pull request #461 from InsanusMokrassar/0.35.9
0.35.9
2021-09-21 23:17:32 +06:00
3e5d939ea5 factory functions of BehaviourContextReceiver's, updates in kdocs and operations for these receivers filters 2021-09-21 21:36:52 +06:00
24f91e4aee Fix of #464 2021-09-21 20:50:59 +06:00
fe169fafaf add kdocs to LocationContent 2021-09-21 18:57:12 +06:00
aeb6fad409 add LocationContent#copy 2021-09-21 18:49:29 +06:00
94ad758814 deprecate old API in Behaviour Builder 2021-09-21 18:39:05 +06:00
5f01e26377 Update CHANGELOG.md 2021-09-21 16:24:12 +06:00
f82ac0ce9d Update gradle.properties 2021-09-21 16:23:47 +06:00
c8491765e9 update dependencies 2021-09-19 15:27:01 +06:00
53a3e11836 fix CustomBotAction annotations 2021-09-17 16:50:54 +06:00
fcccbe3252 Update CHANGELOG.md 2021-09-17 09:17:48 +06:00
584bf06109 Update gradle.properties 2021-09-17 09:17:28 +06:00
ef0083079e Update gradle.properties 2021-09-16 10:09:28 +06:00
0d01e9bc78 add kdocs for filters 2021-09-15 15:07:38 +06:00
89aef3d77b kdocs for triggers in behaviour builder 2021-09-15 14:58:45 +06:00
24c47b00d4 BehaviourContext#followLocation 2021-09-14 16:16:06 +06:00
a046a72392 waitEditedContent* extensions 2021-09-14 16:04:58 +06:00
a5a530c9bd TelegramBot#answer 2021-09-14 15:51:05 +06:00
9cf82a3564 subcontext filter and inBlock filter in behaviour context triggers 2021-09-13 23:30:01 +06:00
46cc37be62 LocationContent -> LiveLocationContent / StaticLocationContent 2021-09-12 17:15:58 +06:00
1fbaf396aa update micro_utils 2021-09-12 15:48:33 +06:00
76985501f5 CustomBotAction 2021-09-12 15:32:36 +06:00
8d8bcfba01 start 0.35.9 2021-09-12 15:29:19 +06:00
e0f3957249 Update CHANGELOG.md 2021-09-09 00:42:57 +06:00
3f1b018808 Merge pull request #457 from InsanusMokrassar/0.35.8
0.35.8
2021-09-08 22:43:23 +06:00
7af5ab17b7 Fixes in TelegramBot#withAction 2021-09-08 22:19:08 +06:00
0fec35f0dc BehaviourContext#commandWithArgs and BehaviourContext#onCommandWithArgs 2021-09-08 21:31:43 +06:00
ee81f49a75 add docs for InputFile 2021-09-08 21:13:42 +06:00
807952201b MPPFile#asMultipartFile 2021-09-08 20:58:44 +06:00
5d6ba0f59e MultipartRequestCallFactory improvements 2021-09-08 20:05:53 +06:00
3a61b522ab update dependencies 2021-09-08 19:59:29 +06:00
83304023a6 start 0.35.8 2021-09-08 19:57:22 +06:00
f62e13aaca Merge pull request #450 from InsanusMokrassar/0.35.7
0.35.7
2021-09-04 17:38:44 +06:00
ae1fb25336 update dependencies 2021-09-04 17:25:29 +06:00
4e3ea6cd80 fixes of annotations 2021-08-30 21:02:51 +06:00
148203eabf update klock 2021-08-30 18:55:13 +06:00
4465b573ca update dependencies 2021-08-27 19:58:21 +06:00
f0dda60630 start 0.35.7 2021-08-27 19:56:18 +06:00
47135a1b65 Merge pull request #444 from InsanusMokrassar/0.35.6
0.35.6
2021-08-23 22:26:56 +06:00
d8f830c60f FlowsUpdatesFilter update 2021-08-22 23:14:56 +06:00
226b8dee21 deprecate allSentMessagesFlow and allSentMedaGroupsFlow 2021-08-22 23:13:59 +06:00
a109771d20 update structure schema 2021-08-22 12:10:05 +06:00
c028434f30 update gradle wrapper 2021-08-22 11:09:35 +06:00
d5c6ce32bb fixes in readme :) 2021-08-22 11:02:14 +06:00
d92cac5e07 small updates in readmes 2021-08-22 10:59:01 +06:00
9b21b5290c update dokka 2021-08-22 10:53:12 +06:00
13ca63d27d update dependencies 2021-08-22 10:47:23 +06:00
ad917dda1b start 0.35.6 2021-08-22 10:35:55 +06:00
7b1344e9c8 Merge pull request #440 from InsanusMokrassar/0.35.5
0.35.5
2021-08-13 20:51:02 +06:00
c4fbd2f1c6 revert type of BuiltinMimeTypes 2021-08-13 18:39:46 +06:00
c90bcea42c add additional mime types 2021-08-13 18:39:08 +06:00
e75c93d626 remove mime types from requests 2021-08-13 14:02:39 +06:00
58dcbe8751 StorageFile#asMultipartFile 2021-08-13 11:45:36 +06:00
17806cde25 add calculation of mimed type from TelegramMediaFile when it is MimedFile 2021-08-13 11:43:36 +06:00
f147a3d620 fix of package for AdditionalContentAsStorageFile 2021-08-13 11:41:57 +06:00
9eb6008a73 convertToStorageFile 2021-08-13 11:37:01 +06:00
f7d2c8bbd2 hotfix 2021-08-10 16:54:15 +06:00
f42cf78969 fixes 2021-08-10 16:50:50 +06:00
9a14932511 small improvement of DownloadFileRequestCallFactory 2021-08-10 11:32:22 +06:00
149ecf175b small improvement of DownloadFileChannelRequestCallFactory 2021-08-10 11:29:46 +06:00
2049fea82a new asStorageFile 2021-08-10 11:08:08 +06:00
40d94cca70 improvements in files downloading api 2021-08-10 10:34:59 +06:00
c8ad68ea69 make ByteReadChannelAllocatorSerializer -> ByteReadChannelAllocatorDeserializationStrategy 2021-08-10 10:12:22 +06:00
c66d64adbc renames 2021-08-09 23:24:12 +06:00
b475976ff1 add streaming file downloading feature 2021-08-09 23:22:08 +06:00
ea8db5b851 rename JVM DownloadFile file 2021-08-09 20:01:26 +06:00
af2fabf1ca fix changelog 2021-08-09 19:55:51 +06:00
abc0457a36 files downloading improvements 2021-08-09 19:55:08 +06:00
8dbdbdee13 start 0.35.5 2021-08-09 19:39:03 +06:00
0c31379ff5 Merge pull request #439 from InsanusMokrassar/0.35.4
0.35.4
2021-08-09 14:18:19 +06:00
3b3cf81aaa Update CHANGELOG.md 2021-08-09 12:26:37 +06:00
1642075a75 Update microutils 2021-08-09 12:21:51 +06:00
760c9f2916 start 0.35.4 2021-08-09 12:21:27 +06:00
219238cf19 Merge pull request #436 from InsanusMokrassar/0.35.3
0.35.3
2021-08-08 18:48:45 +06:00
762087fc09 optimize imports 2021-08-08 18:00:42 +06:00
142fae1ede remove WithLanguageCode 2021-08-08 17:55:27 +06:00
95abc72bf3 WithOptionalLanguageCode?.javaLocale 2021-08-08 17:47:18 +06:00
1d37a7446c add companions for SimpleRequestCallFactory and MultipartRequestCallFactory 2021-08-08 17:44:20 +06:00
7d35114b5d classcasts fill for WithOptionalLanguageCode 2021-08-08 16:43:49 +06:00
75f4226772 base ktor request call factories became classes to avoid sharing of their cache between bots 2021-08-08 16:14:43 +06:00
96d980cb8a fix build 2021-08-06 12:02:26 +06:00
ed077ae1bc filters in waiters 2021-08-06 10:32:31 +06:00
9540797ffc Revert "update classcasts"
This reverts commit 217b01994e.
2021-08-06 09:15:30 +06:00
217b01994e update classcasts 2021-08-05 23:54:30 +06:00
6b89c94ef1 include support of ietf language codes 2021-08-05 23:36:01 +06:00
e25ce57f6a update microutils version 2021-08-05 23:12:17 +06:00
530394fd15 SimpleFilter 2021-08-03 11:46:23 +06:00
3e891d50fd downloadFile for MediaContent 2021-08-03 11:33:52 +06:00
adf5fd6288 improvements in buildBehaviour 2021-08-03 11:27:39 +06:00
e7a2dc51aa update dependencies 2021-08-03 11:18:30 +06:00
399793243b start 0.35.3 2021-08-03 11:14:21 +06:00
3801025ff1 Merge pull request #428 from InsanusMokrassar/0.35.2
0.35.2
2021-07-17 13:43:02 +06:00
0ad2d9afc4 Fill changelog with versions updates 2021-07-17 13:40:05 +06:00
a303700b56 Update gradle.properties 2021-07-15 23:00:08 +06:00
42bf896f7a Update gradle.properties 2021-07-10 00:42:04 +06:00
0bce522101 Update gradle.properties 2021-07-10 00:03:20 +06:00
3c75d6a2c7 Update dependencies 2021-07-09 11:23:33 +06:00
93eebe37ce Update CHANGELOG.md 2021-07-09 11:20:33 +06:00
f893803939 start 0.35.2 2021-07-09 11:18:54 +06:00
0b92edc05e Update gradle-wrapper.properties 2021-07-03 23:41:48 +06:00
190d83b22b Merge pull request #421 from InsanusMokrassar/0.35.1
0.35.1
2021-06-30 14:51:30 +06:00
7ec4fc460a fix build 2021-06-30 14:01:59 +06:00
75cebf5aa3 add GetUpdatesConflict 2021-06-30 13:57:20 +06:00
a241c91adf waitContentMessage with includeMediaGroups 2021-06-30 11:45:56 +06:00
4f920abb61 upfixes 2021-06-30 11:26:31 +06:00
6ba9a31fb9 seal of MediaGroupUpdates 2021-06-30 11:12:09 +06:00
65801f5104 Update CHANGELOG.md 2021-06-30 10:40:23 +06:00
9e82211473 Merge pull request #422 from eboshare/0.35.1
Add Update#sourceUser method
2021-06-30 10:39:00 +06:00
Vasya
560179a574 simplify Update#sourceUser 2021-06-29 21:47:15 +03:00
Vasya
cffcf2277e add asFromUser, whenFromUser, requireFromUser to ClassCasts.kt 2021-06-29 21:35:46 +03:00
Vasya
cb9a20a9d1 Merge remote-tracking branch 'upstream/0.35.1' into 0.35.1
# Conflicts:
#	tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/InlineQueries/abstracts/ChosenInlineResult.kt
2021-06-29 21:23:20 +03:00
vasya
45ea103c9a bring back strange InsanusMokrassar's space :) 2021-06-29 21:08:41 +03:00
vasya
c00adb0784 remove redundant import in LeftChatMember.kt 2021-06-29 21:07:18 +03:00
vasya
38826a5e7e remove FromUser interface from RawChosenInlineResult 2021-06-29 21:06:46 +03:00
b2915857d7 remove usages of deprecated ChosenInlineResult 2021-06-29 11:55:46 +06:00
067e36adc6 ChosenInlineResult now is sealed 2021-06-29 11:53:36 +06:00
vasya
12a35da4b6 remove unnecessary FromUser usages 2021-06-29 03:34:27 +03:00
vasya
022e6f623a add FromUser interface to objects where field user is present 2021-06-29 00:57:32 +03:00
vasya
30c138029e add asFromUserMessage calls to Update#sourceUser 2021-06-29 00:37:53 +03:00
732e2a3906 serializable subclasses of MessageContent 2021-06-29 00:06:07 +06:00
c5e089a45d make*String extensions 2021-06-29 00:01:40 +06:00
vasya
919b1590e3 add Update#sourceUser method 2021-06-28 20:30:12 +03:00
0c1017901f optimize imports 2021-06-28 11:12:51 +06:00
fd6e4b0522 final refactor, fixes and upfilling of changelog 2021-06-28 11:10:09 +06:00
21c5d42dc2 BehaviourContext now is interface 2021-06-28 10:29:45 +06:00
77dff639f0 updates 2021-06-28 01:00:20 +06:00
47fe048b10 refactor and fixes in ContentTriggers 2021-06-27 19:28:21 +06:00
ee8cc2aa46 defaultExceptionsHandler in behaviour builder 2021-06-26 17:05:34 +06:00
b9de002517 rewrite to use subscribeSafelyWithoutExceptionsAsync in triggers of behaviour builder 2021-06-26 12:15:52 +06:00
449f2727c4 update dependencies 2021-06-26 02:04:08 +06:00
8712914126 update actuality of core 2021-06-26 01:59:25 +06:00
69b64e9908 and more... :) 2021-06-26 01:58:20 +06:00
656bb68739 add support of input_field_placeholder 2021-06-26 01:48:41 +06:00
7f69052dea *MyCommands actualization 2021-06-26 01:42:35 +06:00
b60fab4871 BotCommandScope 2021-06-26 01:27:28 +06:00
bf28a8b0a6 add performInParallel for behaviour builder 2021-06-25 12:45:20 +06:00
85270dd12d update micro_utils 2021-06-24 14:34:58 +06:00
e39dd2d086 remove redundant fsm module 2021-06-24 12:56:40 +06:00
e10d47b7e4 fill changelog 2021-06-24 12:56:15 +06:00
1e181bc042 fixes 2021-06-24 12:54:50 +06:00
61cf9936fb complete migration of replies 2021-06-24 12:49:47 +06:00
65fd3ced36 start replacement of reply methods 2021-06-24 11:21:02 +06:00
66d37b72eb add when* syntax 2021-06-23 22:14:45 +06:00
55b1d3734d telegramBotWithBehaviour 2021-06-23 21:51:30 +06:00
45b32fd6f7 start 0.35.1 2021-06-23 21:20:28 +06:00
fcd8f20a90 Update README.md 2021-06-17 15:34:53 +06:00
18e6b9e471 Merge pull request #395 from InsanusMokrassar/0.35.0
0.35.0
2021-06-06 09:05:09 +06:00
f5b248f534 update micro_utils 2021-06-05 15:48:38 +06:00
3ebcbe2860 builder extending 2021-06-04 01:07:53 +06:00
3829e04b0c Update CHANGELOG.md 2021-06-04 00:32:42 +06:00
39fa36426f Update CHANGELOG.md 2021-06-03 23:25:19 +06:00
a265e5ecbf Update CHANGELOG.md 2021-06-03 23:09:46 +06:00
86e78c4ba0 Update packages_publishing.yml 2021-05-30 01:20:25 +06:00
a6451ca394 update workflows to separate build and publishing 2021-05-29 17:05:18 +06:00
521a3a8c35 fix internal deprecations 2021-05-29 16:02:55 +06:00
173839c677 small refactoring 2021-05-29 15:51:45 +06:00
bb7d47a33b fix build 2021-05-29 15:46:13 +06:00
5c0e58caec buildable except of jvm tests 2021-05-29 15:34:14 +06:00
72c3623d30 small fillup of changelog 2021-05-29 14:32:45 +06:00
fe1831fc19 deprecations removed 2021-05-29 14:31:44 +06:00
7825ec3010 a lot of types has been converted to sealed 2021-05-29 14:23:25 +06:00
12184cd2be InlineKeyboardButton now is an interface 2021-05-29 13:40:48 +06:00
e90e25ab01 BotAction now is an interface 2021-05-29 13:39:43 +06:00
004ff0b490 update dependencies and changelog 2021-05-29 13:29:01 +06:00
07faba7d38 Update CHANGELOG.md 2021-05-27 00:04:42 +06:00
e5584cd8b4 Update gradle.properties 2021-05-27 00:04:11 +06:00
6acc9ef2b0 update klock 2021-05-26 22:00:57 +06:00
169fc0401a update dependencies 2021-05-26 21:55:09 +06:00
dcfcea65cb start 0.35.0 2021-05-26 21:51:29 +06:00
eedb36ede7 Merge pull request #383 from InsanusMokrassar/gradle-wrapper/6.9
Update gradle-wrapper
2021-05-08 17:19:21 +06:00
eaee334ff6 Update gradle-wrapper.properties 2021-05-08 16:44:14 +06:00
5c694e8625 Update CHANGELOG.md 2021-05-06 13:24:23 +06:00
0306c40fb2 Update CHANGELOG.md 2021-05-06 13:24:11 +06:00
fd915553e3 Merge pull request #381 from InsanusMokrassar/0.34.1
0.34.1
2021-05-05 19:37:32 +06:00
ec1c0ba8bb update microutils 2021-05-05 19:20:51 +06:00
12a64ec1d1 update ktor 2021-05-05 19:12:59 +06:00
59d7a7c781 fix in text sources list creating 2021-05-05 19:02:22 +06:00
cabfd7c76b start 0.34.1 2021-05-05 18:53:26 +06:00
f12f52899c Merge pull request #369 from InsanusMokrassar/renovate/org.jetbrains.dokka-gfm-plugin-1.x
Update dependency org.jetbrains.dokka:gfm-plugin to v1.4.32
2021-04-30 09:55:54 +06:00
Renovate Bot
ed067db20f Update dependency org.jetbrains.dokka:gfm-plugin to v1.4.32 2021-04-29 13:36:31 +00:00
b055268979 Merge pull request #362 from InsanusMokrassar/0.34.0
0.34.0
2021-04-29 19:03:29 +06:00
2584839d66 update core readme 2021-04-29 19:02:51 +06:00
63946e860d note about UnknownExtendedChat 2021-04-29 17:45:19 +06:00
90df436c63 small refactor of usage TextedInput 2021-04-29 17:40:01 +06:00
d3c8b49b10 Update CHANGELOG.md 2021-04-29 17:33:27 +06:00
c1372b55bc Note about ChatType in CHANGRLOG 2021-04-29 15:26:08 +06:00
b6c7ece995 small hotfix 2021-04-29 15:09:45 +06:00
44e7c80f43 remove redundant extensions for parseCommandsWithParams 2021-04-29 15:08:05 +06:00
1e41e95333 fixes in parseCommandsWithParams 2021-04-29 15:07:16 +06:00
03d4d715c0 hotfix 2021-04-29 11:59:44 +06:00
ab060d02ea deprecate Explained 2021-04-29 11:59:44 +06:00
f447be02dc Update InlineKeyboardMarkup.kt 2021-04-29 01:18:07 +06:00
eb923a6338 fixes 2021-04-28 23:22:13 +06:00
0914710cc7 update voice chats 2021-04-28 20:08:02 +06:00
1f7450844f optimize imports 2021-04-28 19:59:30 +06:00
167c214e35 migration to avoid using of TextPart 2021-04-28 19:54:57 +06:00
42a8d649cd Update CHANGELOG.md 2021-04-27 23:43:04 +06:00
eb3f180cc6 textSources now is main property 2021-04-27 16:08:36 +06:00
70f96ac8fa completing of captioned input deprecation 2021-04-26 21:34:13 +06:00
d69b2e09d5 migration from CaptionedInput 2021-04-26 21:25:52 +06:00
946b0222df fix botaction tests 2021-04-26 21:10:38 +06:00
7da315dbaf fix botaction tests 2021-04-26 21:08:52 +06:00
87071ca52c deprecation of an old record audio and upload audio bot actions 2021-04-26 21:02:11 +06:00
b2770e3ecc record_voice and upload_voice 2021-04-26 20:52:20 +06:00
df63ccfe07 VoiceChatScheduled 2021-04-26 20:47:03 +06:00
694bec22a2 include chat_type 2021-04-26 20:42:26 +06:00
6a3588bb8d InputInvoiceMessageContent 2021-04-26 20:23:26 +06:00
a26568aa29 maxTipAmounts and suggestedTipAmounts support in SendInvoice 2021-04-26 20:01:14 +06:00
cd30660256 update SendInvoice 2021-04-26 19:28:19 +06:00
1846d20b0d start 0.34.0 2021-04-26 19:15:55 +06:00
f13207064e Merge pull request #361 from InsanusMokrassar/0.33.4
0.33.4
2021-04-17 16:02:14 +06:00
61be689aca fix of build 2021-04-17 14:36:23 +06:00
03f8d65bb6 fix of build 2021-04-17 11:14:35 +06:00
2dc8beba8a update classcasts 2021-04-16 22:00:45 +06:00
5451adf4ac FromUserMessage extends Message 2021-04-16 18:07:27 +06:00
9982534001 updates in TextSourceSerializer 2021-04-15 14:34:05 +06:00
c0451d4c8f Update gradle-wrapper.properties 2021-04-15 13:56:52 +06:00
a9d65944e6 update MicroUtils 2021-04-13 15:53:35 +06:00
39598dcb69 fill CHANGELOG 2021-04-13 01:54:45 +06:00
3069a6084c fixes in parseCommandsWithParams 2021-04-13 01:50:41 +06:00
e7bbce3fa7 update uuid dependency 2021-04-12 23:32:50 +06:00
0b361163f2 TextSourceSerializer 2021-04-12 23:23:18 +06:00
6aba2ff641 start 0.33.4 2021-04-12 20:57:12 +06:00
6b761ab37d Update gradle wrapper 2021-04-11 04:06:30 +06:00
b9c8a89af9 Merge pull request #357 from InsanusMokrassar/0.33.3
0.33.3
2021-04-05 19:41:52 +06:00
a42c5c63c4 fillup changelog 2021-04-05 19:08:12 +06:00
fc1a029acb fix of #358 2021-04-05 19:06:49 +06:00
f90ae2f918 include weakLaunch in behaviour builder 2021-04-05 18:15:10 +06:00
019b260888 update ktor 2021-04-05 18:11:29 +06:00
0831f2fa75 update microutils 2021-04-05 17:21:59 +06:00
32ae9d2b16 hotfix 2021-04-05 16:50:31 +06:00
b975a1b036 updates in behaviour builder 2021-04-05 16:41:27 +06:00
f4b1e4a150 start 0.33.3 2021-04-05 13:42:48 +06:00
97031512d4 Merge pull request #356 from InsanusMokrassar/0.33.2
0.33.2
2021-04-03 15:39:14 +06:00
353df43109 update microutils 2021-04-03 15:13:20 +06:00
4e55460834 fix in doInSubContext 2021-04-03 15:05:25 +06:00
e2e235bd6c behaviour builder updates 2021-04-03 14:51:21 +06:00
8ced95bc2f start 0.33.2 2021-04-03 14:24:24 +06:00
685e4af8f5 Merge pull request #345 from InsanusMokrassar/0.33.1
0.33.1
2021-03-26 09:13:15 +06:00
0b2f7a3899 update condition for ReplyMessageNotFoundException 2021-03-26 07:03:33 +06:00
112c86c9da remove caption based messages extension for parsing of commands 2021-03-24 13:56:51 +06:00
1ddd138ff7 update kdocs for new function 2021-03-24 13:44:27 +06:00
1a5d1cde78 add parseCommandsWithParams for text inputs 2021-03-24 13:43:32 +06:00
5b620014cb update kotlin version 2021-03-24 13:14:09 +06:00
80093cb5a9 Update kdocs.yml 2021-03-21 23:22:16 +06:00
9f8e8ee21b update dependencies 2021-03-19 20:20:07 +06:00
3de3bb6133 start 0.33.1 2021-03-19 20:18:32 +06:00
308fb9274b Update kdocs.yml 2021-03-17 21:14:05 +06:00
d14ca7bbdc Update kdocs.yml 2021-03-17 21:13:52 +06:00
dbdd9b5ad2 update dokka 2021-03-16 23:01:26 +06:00
6dd27cb0bf fixes in names of workflows 2021-03-16 22:41:45 +06:00
210a52485b add kdocs yml config 2021-03-16 22:39:54 +06:00
5c11b60ea6 fix dokka config 2021-03-16 22:33:53 +06:00
60c3a0d7af update core info about current version 2021-03-16 22:21:15 +06:00
8d777e1c0e Update dokka version 2021-03-16 16:30:13 +06:00
4e019eb8bb Update packages_publishing.yml 2021-03-12 20:11:26 +06:00
bd80562c2a Merge pull request #337 from InsanusMokrassar/0.33.0
0.33.0
2021-03-12 15:47:24 +06:00
9fc07f2ff3 fix build 2021-03-12 15:03:11 +06:00
a4bae5133a fill changelog 2021-03-12 14:58:13 +06:00
7bb272f2fa update compatibility note 2021-03-12 14:39:27 +06:00
72cf38d3bb fill Behaviour Builder for ChatMemberUpdated 2021-03-12 14:36:10 +06:00
0adee13cba remove deprecations 2021-03-11 22:28:56 +06:00
f9e3e57f24 migrate 0.32.10 -> 0.33.0 2021-03-11 21:44:08 +06:00
d7d4adc8e4 optimize imports 2021-03-11 21:39:34 +06:00
e9b074a36c updates of FlowsUpdatesFilter 2021-03-11 21:36:29 +06:00
65cba0f014 fill api of chat invite links 2021-03-11 21:25:11 +06:00
36202133a1 update classcasts 2021-03-11 21:06:25 +06:00
66f7801b32 fix ChatInviteLinkRequest 2021-03-11 20:41:47 +06:00
e7265829d1 include ChatMemberUpdated functionality 2021-03-11 20:17:08 +06:00
9ad5bfbc57 remove BotInviteChatLink 2021-03-11 16:36:15 +06:00
aba62ba930 chatmember serializers are public 2021-03-11 16:00:47 +06:00
40d702a311 add representations of all chat invite link functionality 2021-03-10 22:46:56 +06:00
233d893b5a add isOff extension for MessageAutoDeleteTimerChanged 2021-03-09 22:33:05 +06:00
0faca5838c fixes in events builder behaviours 2021-03-09 22:14:16 +06:00
838f62aa84 shortcuts seconds24Hours and seconds7Days are consts for now 2021-03-09 22:06:20 +06:00
bc21a680bc fixes for MessageAutoDeleteTimerChanged 2021-03-09 22:00:17 +06:00
8bb60bea34 now MessageAutoDeleteTimerChanged implementing ChannelEvent and GroupEvent 2021-03-09 21:37:25 +06:00
8daadcff95 now MessageAutoDeleteTimerChanged implementing ChannelEvent and GroupEvent 2021-03-09 21:35:53 +06:00
2a1e624641 VoiceChatParticipantsInvited type now is data class 2021-03-09 20:23:03 +06:00
696822db02 add behaviour builder events updates 2021-03-09 20:04:44 +06:00
ded501d963 remove regular build 2021-03-09 19:52:46 +06:00
86e506c33d include message_auto_delete_timer_change 2021-03-09 19:45:19 +06:00
9902b00e85 include revokeMessages in kickChatMember 2021-03-09 19:33:05 +06:00
53524abcbb include canManageChat 2021-03-09 19:26:30 +06:00
7639b15dc6 voice chats functionality included 2021-03-09 19:19:15 +06:00
61b720c61f fix of content waiters and expecters 2021-03-09 16:54:32 +06:00
baf4c74b69 update micro_utils 2021-03-09 16:46:08 +06:00
367cfff2cb start 0.32.10 2021-03-09 16:45:13 +06:00
75e8d0f62d Merge pull request #325 from InsanusMokrassar/0.32.9
0.32.9
2021-03-05 01:08:58 +06:00
c521a5f9a4 Update CHANGELOG.md 2021-03-03 22:32:44 +06:00
c5513365c2 Update gradle.properties 2021-03-03 22:31:29 +06:00
d184ce7a0f Update mpp_publish_template.kpsb 2021-03-03 01:39:18 +06:00
a3bff3f24d Update publish.gradle 2021-03-03 01:37:38 +06:00
a835b1dcbb Update mpp_publish_template.kpsb 2021-03-03 01:33:50 +06:00
ffed2b80a5 update publish scripts to avoid useless repos 2021-03-02 16:45:13 +06:00
ff24b9f35b add workflow for packages publication 2021-03-02 16:25:55 +06:00
1287852334 update microutils version 2021-03-02 15:26:52 +06:00
fc2f177e38 update dependencies 2021-02-28 22:24:34 +06:00
1efd4dce6e start 0.32.9 2021-02-28 22:21:57 +06:00
69b5a16b17 Update gradle-wrapper.properties 2021-02-23 09:53:45 +06:00
77b531ad06 Merge pull request #307 from InsanusMokrassar/0.32.8
0.32.8
2021-02-22 01:35:40 +06:00
a98d5d9abd update micro_utils 2021-02-21 22:50:47 +06:00
104653ac41 update serialization 2021-02-21 21:15:40 +06:00
63337b8285 start 0.32.8 2021-02-21 21:13:23 +06:00
5cc0bbb31b Merge pull request #303 from InsanusMokrassar/0.32.7
0.32.7
2021-02-18 00:34:46 +06:00
563d784603 RestrictionsChatPermissions 2021-02-18 00:28:36 +06:00
0d9f18f346 DiceAnimationType class casts 2021-02-17 22:29:29 +06:00
23ceaf8e97 LeftRestrictionsChatPermissions 2021-02-17 22:12:58 +06:00
fe2dffd8b5 BehaviourContext updates 2021-02-17 22:11:26 +06:00
eeb46817c3 start 0.32.7 2021-02-17 22:00:46 +06:00
5ab00da31d Merge pull request #300 from InsanusMokrassar/0.32.6
0.32.6
2021-02-17 17:15:40 +06:00
841ae73f7c replyWithDice 2021-02-17 17:10:21 +06:00
41b4d29917 updates in slot machine utils 2021-02-17 16:58:57 +06:00
f8b3c44146 update micro_utils 2021-02-16 13:48:32 +06:00
f0eb670c3f start 0.32.6 2021-02-16 13:47:31 +06:00
fe5d94f31e Update README.md 2021-02-13 10:09:33 +06:00
7901d0a223 Update README.md 2021-02-13 01:42:35 +06:00
799f9123ba Update README.md 2021-02-13 01:38:31 +06:00
f77f010e66 Update README.md 2021-02-11 13:38:55 +06:00
67ddf8d809 Update README.md 2021-02-11 13:37:24 +06:00
81afa46253 Update README.md 2021-02-11 13:36:53 +06:00
a5bba76f07 Update README.md 2021-02-11 13:35:06 +06:00
d882cf9c97 update readme 2021-02-11 12:06:34 +06:00
2e27b8b64d Merge pull request #295 from InsanusMokrassar/0.32.5
0.32.5
2021-02-09 19:13:42 +06:00
4df800eaa9 fix of #291 2021-02-09 19:07:31 +06:00
8d27349868 update content resends and different other things 2021-02-09 18:26:10 +06:00
2a89c41a58 fix of #292 2021-02-09 17:15:28 +06:00
098b5cc393 rewrite createAccumulatedUpdatesRetrieverFlow onto channelFlow 2021-02-09 16:33:48 +06:00
10f4817283 solution of #293 2021-02-08 19:35:32 +06:00
4449893608 fix of #294 2021-02-08 18:15:54 +06:00
3a53f41f66 start 0.32.5 2021-02-08 11:36:20 +06:00
7cd366d893 Update README.md 2021-02-07 18:02:20 +06:00
1309a4111c Merge pull request #290 from InsanusMokrassar/0.32.4
content messages renames
2021-02-07 16:59:51 +06:00
0ca815760b content messages renames 2021-02-07 16:54:48 +06:00
eca0680f2f update readme 2021-02-07 12:44:38 +06:00
d472d371ed Merge pull request #282 from InsanusMokrassar/0.32.4
0.32.4
2021-02-07 12:43:08 +06:00
4748b6813a ExceptionsOnlyLimiter now will not use Result to provide success/failure state of result 2021-02-07 12:40:05 +06:00
a2ea15d4b0 update wrapper version 2021-02-07 11:02:13 +06:00
27dc302f5d update for compiling 2021-02-06 11:53:30 +06:00
baf8ed3a77 now JVM part will be compiled with IR 2021-02-06 00:52:39 +06:00
18913af3c3 update publishing scripts 2021-02-06 00:50:51 +06:00
51871ea94c update micro_utils version 2021-02-05 16:08:45 +06:00
6a625d7b9f update publishing scripts 2021-02-05 16:08:28 +06:00
0b93b472a3 update klock 2021-02-05 14:22:42 +06:00
ff16f9a315 Update README.md 2021-02-05 01:18:38 +06:00
86bfe043a5 update dependencies 2021-02-03 23:05:17 +06:00
fa18e7299d 0.32.4 2021-02-03 22:59:37 +06:00
c986025075 Merge pull request #277 from InsanusMokrassar/0.32.3
0.32.3
2021-02-02 11:44:53 +06:00
e8a7ea9ce4 inline qieries expectators and waiters 2021-02-02 11:17:51 +06:00
30f35e5488 start 0.32.3 2021-02-02 11:07:30 +06:00
b626974ea7 Create dependabot.yml 2021-02-01 23:22:26 +06:00
128b782a27 Merge pull request #276 from InsanusMokrassar/0.32.2
0.32.2
2021-02-01 21:43:21 +06:00
dc83b8d77a fix of #275 and several other internal problems 2021-02-01 21:09:11 +06:00
2aac6c0bde start 0.32.2 2021-02-01 21:04:54 +06:00
b637d0d2a6 Merge pull request #274 from InsanusMokrassar/0.32.1
0.32.1
2021-01-30 21:06:15 +06:00
d12cba2343 replacing of withContent and requireWithContent and extending of extensions receivers types 2021-01-30 20:59:26 +06:00
450c7e6474 fix of #273 2021-01-30 20:05:07 +06:00
a35fb40a66 fix of #272 2021-01-30 19:35:53 +06:00
8731aa2c26 start 0.32.1 2021-01-30 19:33:38 +06:00
32e305537d Merge pull request #260 from InsanusMokrassar/0.32.0
0.32.0
2021-01-29 17:00:06 +06:00
ec0a10e36e fillup changelog 2021-01-29 13:28:18 +06:00
131ec4d6d5 renames of EncryptedPassportElements 2021-01-29 12:44:13 +06:00
ecc608f51a add additional variant of doInDecryptionContextWithPKCS8Key 2021-01-29 10:44:11 +06:00
040654f131 refill readme 2021-01-29 01:18:44 +06:00
9e73d0c461 add opportunity to manually set up delay for media groups webhooks 2021-01-29 00:56:47 +06:00
d67c80bc99 ClassCasts update for SecureValue 2021-01-28 22:21:21 +06:00
b0eef4f82d update ktor 2021-01-28 22:06:52 +06:00
fbe91a6321 complete preview tools for passport 2021-01-28 22:03:14 +06:00
15066c9d63 add SecureData and DecryptedCredentials 2021-01-28 17:08:25 +06:00
e0bf67d8f9 global update of passport 2021-01-28 16:03:30 +06:00
1dc3ce2fb5 add passport in API 2021-01-25 10:43:51 +06:00
0c71133969 add expectations and triggers for passport 2021-01-25 10:29:11 +06:00
1359dd549f Create regular-build.yml 2021-01-25 04:42:23 +06:00
c425e2ecc3 update classcasts 2021-01-23 21:10:57 +06:00
4d63e3a17d complete tools for handling of encrypted data 2021-01-23 20:50:46 +06:00
d34deade0d temporal state (currently tools for files decryption in JS do work 2021-01-23 18:49:41 +06:00
2f52ad45a4 add tools for passport files hashes calculation 2021-01-23 12:21:57 +06:00
1d99e632a4 fix of SetPassportDataErrors request parent interface 2021-01-22 23:40:33 +06:00
cdcfaf5a29 fixes in passport errors serialization and replacing of PassportElementError 2021-01-22 23:14:24 +06:00
f3590762f3 add PassportElementError realization 2021-01-22 23:01:37 +06:00
e0ff14b7fe update gradle wrapper 2021-01-22 21:57:23 +06:00
9983e111ec update EncryptedElementSerializer 2021-01-22 21:53:37 +06:00
08b8710772 add asAction and several variants of oneOf 2021-01-19 20:19:28 +06:00
fc71e028c4 improving work of behaviour_builder 2021-01-19 18:50:45 +06:00
30a4a7bd8b update micro_utils dependency 2021-01-19 13:52:06 +06:00
b973278b0a add note about breaking changes 2021-01-19 11:00:12 +06:00
ae2f4579e2 start 0.32.0 as a migration from 0.31.1 due to breaking changes in MediaGroupMessage type 2021-01-19 10:52:30 +06:00
a4bf6911c7 Update micro_utils version note 2021-01-19 00:40:29 +06:00
73b3daa68b Update micro_utils dependency 2021-01-19 00:39:46 +06:00
09748615ae optimize imports 2021-01-18 23:43:21 +06:00
2dc8521aed now all data field are predecrypted with Base64StringSerializer 2021-01-17 16:44:56 +06:00
81de59f37c fix of translations in UtilityBill 2021-01-17 16:34:05 +06:00
fb61a94c5e fix defaults in encrypted passport data 2021-01-17 16:30:25 +06:00
26fd5e51bf filesSize in PassportFile is nullable for now 2021-01-17 16:24:33 +06:00
c1ab9da4c4 fix error with deserialization of passport data 2021-01-17 16:11:38 +06:00
6b414d64b0 remove redundant imports 2021-01-17 15:45:20 +06:00
5a3edc2b44 add passportMessages extension 2021-01-17 15:43:08 +06:00
6dcdc2ab7f now PassportMessage contains user too 2021-01-17 15:35:25 +06:00
a2ae4f71de new PassportMessage type 2021-01-15 16:27:22 +06:00
5d87b86afe update passport data to use Base64StringSerializer 2021-01-15 16:02:16 +06:00
ef22735894 add base64 serialization dependency and update micro_utils up to 0.4.17 2021-01-14 21:27:58 +06:00
c0ea479fe3 add primitives for Telegram Passport API 2021-01-14 14:03:25 +06:00
0846e816e9 start 0.31.1 2021-01-14 12:37:31 +06:00
d837c9d605 update publication scripts 2021-01-13 14:21:35 +06:00
d1993842c3 Merge pull request #257 from InsanusMokrassar/0.31.0
0.31.0
2021-01-10 13:08:00 +06:00
4e8a9dcff0 update changelog 2021-01-09 22:35:41 +06:00
10eb15e172 several RiskFeature updates 2021-01-09 22:18:31 +06:00
0320da7614 updates in long polling methods 2021-01-09 22:10:38 +06:00
7aa3ff180e several refactoring things and docs appending 2021-01-09 21:50:02 +06:00
a882a212c2 remove different internal strings things 2021-01-09 21:24:13 +06:00
1b15748f65 optimize imports 2021-01-09 20:59:37 +06:00
044fe5eadf full removing of old redundant "fullEntitiesList" 2021-01-09 20:52:21 +06:00
9453ec37e7 update gradle wrapper 2021-01-09 19:01:14 +06:00
3d0cbc2d2b small refactor 2021-01-09 19:00:41 +06:00
198b551ebf deprecations removing 2021-01-09 18:25:11 +06:00
1452e32293 behaviours documentatio and changing of buildBehaviour signature 2021-01-09 18:04:45 +06:00
946b7abcae start 0.31.0 2021-01-08 16:58:25 +06:00
879943622a Merge pull request #254 from InsanusMokrassar/0.30.13
0.30.13
2021-01-08 16:50:14 +06:00
c0b4b523cf update micro_utils version 2021-01-08 16:41:08 +06:00
49e6e9cfe3 fix in new project publication scripts 2021-01-08 16:39:29 +06:00
ffadb6355b fixes in readme 2021-01-08 16:37:03 +06:00
9cc402b42d ContentMessage -> CommonMessage in behaviour_builder, fill readme of behaviour_builder and update projects schema 2021-01-08 16:28:00 +06:00
b9341f89ac add media groups triggers and waiters 2021-01-08 11:02:18 +06:00
ac07f44c81 change public signature of waiters 2021-01-08 10:29:29 +06:00
2e53247726 now content waiters and triggers may have set up manually parameter "includeMediaGroups" 2021-01-08 10:22:29 +06:00
e2dddf96a1 several small additions 2021-01-08 00:30:29 +06:00
ce0fceb240 include media groups 2021-01-08 00:22:19 +06:00
633239961a update FlowsUsh 2021-01-07 19:02:35 +06:00
8b79b15777 FlowsUpdatesFilter#allUpdatesWithoutMediaGroupsGroupingFlow 2021-01-07 19:01:02 +06:00
a28cf5ddff now BehaviourContext is UpdateFilterm TelegramBot and CoroutineScope 2021-01-07 18:20:23 +06:00
8c2cffc8e3 rename steps subproject to behaviour_builder 2021-01-07 18:17:50 +06:00
b933361258 optimize imports in steps 2021-01-07 18:12:37 +06:00
383e722d07 rename scenario to behaviour context 2021-01-07 18:11:24 +06:00
3125c2fc1b add callback query expectations and triggers 2021-01-07 17:57:08 +06:00
965b8c3c50 add chat event triggers and expectations in steps 2021-01-07 17:24:58 +06:00
94745ef373 add docs to base expectations 2021-01-07 16:01:25 +06:00
aee5ab564b optimize imports 2021-01-07 12:45:54 +06:00
c70f0b65dd add content triggers and update command 2021-01-07 12:45:30 +06:00
30e6f68228 small update of scenarios 2021-01-06 23:21:33 +06:00
00873a255c preview state of steps 2021-01-06 23:06:48 +06:00
6bd423dc11 class casts for ResendableContent and TextSource 2021-01-06 20:49:55 +06:00
c5ada8cea0 start 0.30.13 2021-01-06 15:41:27 +06:00
0cb3df4d1a Merge pull request #251 from InsanusMokrassar/0.3.12
0.3.12
2021-01-05 23:06:35 +06:00
b22118b400 add suppressing of unchecked casts 2021-01-05 23:04:09 +06:00
2006e45b57 last update of classcasts 2021-01-05 23:02:00 +06:00
c091098feb remove *Impl casts 2021-01-05 22:37:52 +06:00
6cf8d47cbf update classcasts 2021-01-05 22:27:42 +06:00
3dc4e9dda4 preview of solution for #145 2021-01-05 11:54:02 +06:00
6407ad1a93 Revert "one more update of klassindex"
This reverts commit f974e5787f.
2021-01-05 11:11:50 +06:00
f974e5787f one more update of klassindex 2021-01-05 11:11:37 +06:00
28a9bbd310 Revert "add klassindex"
This reverts commit 599d5a51e3.
2021-01-05 01:37:01 +06:00
599d5a51e3 add klassindex 2021-01-05 01:36:52 +06:00
25f8d15a4b start 0.3.12 2021-01-05 00:16:11 +06:00
66c2cb2d30 Merge pull request #243 from InsanusMokrassar/0.30.11
0.30.11
2021-01-04 14:35:56 +06:00
74fb448378 update klock 2021-01-04 14:29:06 +06:00
3417ec060f Update README.md 2021-01-03 15:22:19 +06:00
4f54a00003 Update README.md 2021-01-03 15:20:42 +06:00
4fb187da30 Update README.md 2021-01-03 15:19:35 +06:00
7637b6f69a Update README.md 2021-01-03 15:17:58 +06:00
9df9af193c bot actions got class-cast shortcuts 2021-01-02 16:06:00 +06:00
ba4b4c4b64 bot actions shortcut 2021-01-02 15:51:26 +06:00
fa0861b8bc update micro_utils 2020-12-23 13:42:00 +06:00
20494e1d4a Update CHANGELOG.md 2020-12-22 17:34:14 +06:00
a404008dee Update dependencies 2020-12-22 17:33:20 +06:00
881205dd80 update dependencies 2020-12-16 14:25:09 +06:00
2096c44811 start 0.30.11 2020-12-13 22:25:57 +06:00
1a3da33589 Merge pull request #237 from InsanusMokrassar/0.30.10
0.30.10
2020-12-08 14:25:00 +06:00
be28c9bd5d update dependencies 2020-12-08 12:03:45 +06:00
a193ef5fd5 buildBot 2020-12-04 16:29:50 +06:00
7c43d3aaa5 update dependencies 2020-12-04 16:13:02 +06:00
e034afc75c start 0.30.10 2020-12-04 16:06:14 +06:00
08e3326d1a Merge pull request #226 from InsanusMokrassar/0.30.9
0.30.9
2020-11-27 00:59:33 +06:00
6dd1825b98 update dependencies 2020-11-27 00:44:29 +06:00
bd4eb29fc1 update limits of dices 2020-11-26 19:37:35 +06:00
2cc66ef13c BowlingDiceAnimationType 2020-11-25 23:09:49 +06:00
9a8175d1c8 update dependencies 2020-11-25 23:02:54 +06:00
25285b2e8a start 0.30.9 2020-11-25 23:01:19 +06:00
bb09f05d7b Merge pull request #223 from InsanusMokrassar/0.30.8
0.30.8
2020-11-21 16:37:47 +06:00
da5e46e59f remove several PreviewFeature 2020-11-21 15:19:31 +06:00
a3f315a73a update micro_utils 2020-11-21 15:15:07 +06:00
43583a885a update versions 2020-11-21 14:40:34 +06:00
ec02257ecd start 0.30.8 2020-11-21 14:32:32 +06:00
29ee4a9396 update publishing urls 2020-11-18 17:51:53 +06:00
2717cb4fc6 exprimentally update publishing scripts 2020-11-18 17:18:51 +06:00
1ce2526401 Merge pull request #217 from InsanusMokrassar/0.30.7
0.30.7
2020-11-17 16:32:19 +06:00
74c480b07e one new telegramBot function 2020-11-17 16:18:58 +06:00
657e9aa770 add KtorRequestsExecutorBuilder 2020-11-17 16:06:25 +06:00
0d19952ba7 PowLimiter and CommonLimiter rewriting (#210) 2020-11-17 15:48:58 +06:00
f8cccc3e17 update gradle 2020-11-17 14:41:53 +06:00
bc1b7c3f25 fix ending of host url in TelegramAPIUrlsKeeper 2020-11-17 13:18:11 +06:00
ec74111a9d update micro_utils version 2020-11-17 12:51:55 +06:00
2dadeb7eb7 start 0.30.7 2020-11-17 12:50:54 +06:00
24bd65501b Update README.md 2020-11-16 21:59:25 +06:00
574ca803fa Update README.md 2020-11-16 21:56:31 +06:00
947e3bf34e add fast start 2020-11-16 21:55:22 +06:00
488158d8fb Merge pull request #214 from InsanusMokrassar/0.30.6
0.30.6
2020-11-16 16:29:46 +06:00
41bf3c7f0b filling of changelog and renaming of new function makeLink -> makeUsernameLink 2020-11-16 16:25:10 +06:00
c2032d21cd TextSource properties has been renamed 2020-11-16 13:32:20 +06:00
6650dd9cfe reworking of links extension 2020-11-16 13:22:08 +06:00
af1d6d6f1a start 0.30.6 2020-11-15 23:05:19 +06:00
a5861d659d Merge pull request #212 from InsanusMokrassar/0.30.5
0.30.5
2020-11-14 19:44:26 +06:00
b36f80a6d3 update micro_utils 2020-11-14 19:41:26 +06:00
7c4f034a6c fixes in imports 2020-11-14 14:41:16 +06:00
3b08bc6dd2 serialization of ChatMember and changing of id type in User 2020-11-14 14:38:54 +06:00
ed87c0ad95 start 0.30.5 2020-11-14 11:19:53 +06:00
c8c0fc2ce8 Merge pull request #211 from InsanusMokrassar/0.30.4
0.30.4
2020-11-12 23:05:49 +06:00
1f40ce1a81 add a lot of shortcuts for events 2020-11-12 22:35:27 +06:00
b0219389fc add several functions and changelog notes 2020-11-12 22:23:10 +06:00
f6ec82b449 deprecate old asChatEventsFlow 2020-11-12 22:04:46 +06:00
71dac70635 deprecations in old functions 2020-11-12 22:02:06 +06:00
98f68a9e1e filling of changelog 2020-11-12 21:54:14 +06:00
e7199e7451 fix use user in group messages 2020-11-12 21:46:33 +06:00
33b50c6c68 events filters 2020-11-12 21:17:11 +06:00
e4ce6f8fc7 fixes in events 2020-11-12 17:44:33 +06:00
8764f18ca8 TextContent now implements TextedInput 2020-11-12 16:57:32 +06:00
b2fa7fee9d rename MultilevelTextSource#textSources 2020-11-12 16:37:17 +06:00
0121e3a104 update micro_utils 2020-11-12 16:33:48 +06:00
f6e5664632 start 0.30.4 2020-11-12 16:31:02 +06:00
c5b7c4e1f5 Merge pull request #209 from InsanusMokrassar/0.30.3
0.30.3
2020-11-11 11:25:25 +06:00
53800d49bf small rework in ExceptionsOnlyLimiter 2020-11-11 11:23:24 +06:00
d83e3eb10a add handling of 429 status 2020-11-11 11:15:19 +06:00
66b4d06064 limiter rework 2020-11-11 10:23:20 +06:00
4fab01b2a2 update micro_utils 2020-11-11 10:15:06 +06:00
b81086c4bb start 0.30.3 2020-11-11 10:14:10 +06:00
d776071cac Update build.gradle 2020-11-11 01:32:25 +06:00
5f33d05deb Update extensions utils dependencies 2020-11-11 01:31:28 +06:00
912cc7217c Update extensions api dependencies 2020-11-11 01:30:31 +06:00
96e00f6e31 Merge pull request #207 from InsanusMokrassar/0.30.2
0.30.2
2020-11-10 21:52:37 +06:00
f8ea5f9515 fix in changelog 2020-11-10 21:45:07 +06:00
9f11c4f1c4 update ktor 2020-11-10 20:56:11 +06:00
9c91980d5d webhook fixes 2020-11-10 20:44:39 +06:00
7376eb5b10 start 0.30.2 2020-11-10 20:01:22 +06:00
6654f27f9d Merge pull request #202 from InsanusMokrassar/0.30.1
0.30.1
2020-11-09 15:16:26 +06:00
d29acce417 add suppressing of unused in EntitiesBuilder 2020-11-09 15:14:48 +06:00
f0f18209f3 a little bit improve EntitiesBuilder 2020-11-09 15:12:57 +06:00
324018a0f6 update publication scripts 2020-11-09 14:45:29 +06:00
b621325e92 update version of microutils and changelog 2020-11-09 08:37:30 +06:00
43e92555c2 Merge pull request #203 from Djaler/entities-dsl
Add builder-style dsl for text sources
2020-11-09 08:26:44 +06:00
Kirill Romanov
5f1ca51e60 Add builder-style dsl for text sources 2020-11-08 23:12:32 +03:00
83edda2dfe add link to bot template 2020-11-08 18:58:52 +06:00
1974c20229 start 0.30.1 2020-11-08 12:07:14 +06:00
499d9b1791 Update README.md 2020-11-08 00:03:41 +06:00
6caa7dd428 Merge pull request #163 from InsanusMokrassar/0.30.0
0.30.0
2020-11-07 23:00:35 +06:00
e8ded44562 rename StorageFile in jvm of common 2020-11-07 22:28:20 +06:00
1e6b0381ee StorageFile factories 2020-11-07 14:44:05 +06:00
1cf7ae7438 add micro_utils and deprecate old coroutine methods 2020-11-07 13:42:10 +06:00
311512b5db fix chat interfaces serializers 2020-11-07 01:34:22 +06:00
d73fa4076f add several extension properties to texted/captioned/explained interfaces 2020-11-06 19:13:59 +06:00
3620350cc0 add simple text dsl for textsources 2020-11-06 18:52:59 +06:00
54cfea9adf fill changelog 2020-11-06 14:42:30 +06:00
6665b6ef03 reorganize text sources and text parts 2020-11-06 14:37:13 +06:00
ee6f0f3d5d add separation of text sources 2020-11-06 12:59:55 +06:00
6ec0fcadd2 rewrite telegramBot functions 2020-11-06 12:29:51 +06:00
c89aa7b9ba telegramBot improvements 2020-11-06 12:07:46 +06:00
cf47cee36a Merge pull request #198 from madhead/issues/190
Fix #190: Support for Google Places values in venue-related methods and types
2020-11-06 11:23:29 +06:00
madhead
824fa9ba09 Fix #190: Support for Google Places values in venue-related methods and types 2020-11-06 00:06:33 +03:00
654d84b1b4 Merge pull request #197 from madhead/issues/175
Fix #175: Support for message_id field in unpinChatMessage method
2020-11-06 02:17:11 +06:00
madhead
c7259e7699 Fix #175: Support for message_id field in unpinChatMessage method 2020-11-05 23:15:23 +03:00
00a75801a8 fixes 2020-11-06 01:14:48 +06:00
e45f9cf46a return serialname for messageId in RawMessage 2020-11-06 00:37:56 +06:00
3b1803e851 remove deprecations 2020-11-06 00:12:14 +06:00
bf1e353615 fix build 2020-11-06 00:05:05 +06:00
99bb8d6e0d update extnsions.api 2020-11-05 23:48:23 +06:00
98d7b9c651 update coroutines :) 2020-11-05 21:42:31 +06:00
765caefc32 implementation of allow sending without reply (#191) 2020-11-05 21:33:11 +06:00
6bdefb6f8f new request CopyMessage (#187) 2020-11-05 20:27:45 +06:00
d5e283e7ba Update all classes which must have "entities"/"caption_entities" fields (#189) 2020-11-05 20:18:16 +06:00
a5982ac881 partially restructurize InlineQueryResult and several its implementators 2020-11-05 18:00:40 +06:00
c0e81b1d6d partially complete rewriting of things according to #189 2020-11-05 16:53:26 +06:00
eb879963f8 isAnonymous support in api 2020-11-05 12:48:44 +06:00
f835167f66 isAnonymous support 2020-11-05 12:47:14 +06:00
ff34b23777 implementation of sender_chat and author_signature 2020-11-05 12:39:59 +06:00
ec806dfd83 Merge pull request #195 from madhead/issues/184
Fix #184: Anonymous Admins: support for is_anonymous flag
2020-11-05 11:38:24 +06:00
madhead
0a73dfb799 Fix #184: Anonymous Admins: support for is_anonymous flag 2020-11-05 01:57:26 +03:00
53b8cc4625 update pollQuestionTextLength 2020-11-05 01:15:03 +06:00
201def826e locations updates 2020-11-05 01:12:14 +06:00
609a959b99 DiceAnimationType#valueLimits 2020-11-04 23:52:22 +06:00
6a05a7ecab add footbal dice animation type 2020-11-04 23:47:01 +06:00
159ea6f1cc UnpinAllChatMessages 2020-11-04 23:44:13 +06:00
0886781d61 add docs for PinChatMessage 2020-11-04 23:41:19 +06:00
60d5581ec6 supporting of private chats in pinChatMessage 2020-11-04 23:38:40 +06:00
2a33216006 disableContentTypeDetection 2020-11-04 23:33:48 +06:00
179bb66183 return SetWebhook without certificate 2020-11-04 23:21:25 +06:00
7a2ecd2dbf getChat updates completing 2020-11-04 23:10:39 +06:00
fd1a15cb5d ExtendedPrivateChat#bio 2020-11-04 22:46:08 +06:00
86a472e814 SetWebhook updates 2020-11-04 22:43:26 +06:00
6d6c544aaf logout and close 2020-11-04 22:17:17 +06:00
dd4d5cd15d start 0.30.0 2020-11-04 22:06:44 +06:00
23dfa4f69d Merge pull request #162 from InsanusMokrassar/0.29.4
0.29.4
2020-11-02 21:51:23 +06:00
1021 changed files with 47106 additions and 9635 deletions

4
.github/FUNDING.yml vendored
View File

@@ -1,5 +1,3 @@
# These are supported funding model platforms
patreon: InsanusMokrassar
custom: ['https://paypal.me/InsanusMokrassar?locale.x=ru_RU']
custom: ['https://www.tinkoff.ru/rm/ovsyannikov.aleksey113/ObMJ712472', 'https://boosty.to/insanusmokrassar']

11
.github/dependabot.yml vendored Normal file
View File

@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://help.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
version: 2
updates:
- package-ecosystem: "gradle" # See documentation for possible values
directory: "/tgbotapi.core" # Location of package manifests
schedule:
interval: "daily"

8
.github/labeler.yml vendored
View File

@@ -1,6 +1,8 @@
api: "TelegramBotAPI-extensions-api/**"
utils: "TelegramBotAPI-extensions-utils/**"
core: "TelegramBotAPI/**" # currently not work
api: "TelegramBotAPI-api/**"
utils: "TelegramBotAPI-utils/**"
behaviour-builder: "TelegramBotAPI-behaviour_builder/**"
behaviour-builder_fsm: "TelegramBotAPI-behaviour_builder-fsm/**"
core: "TelegramBotAPI-core/**" # currently not work
code: "**/*.kt"
gradle: "**/*.gradle"

21
.github/workflows/kdocs.yml vendored Normal file
View File

@@ -0,0 +1,21 @@
name: Publish KDocs
on:
push:
branches:
- master
jobs:
publishing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Build
run: ./gradlew dokkaHtml
- name: Publish KDocs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/build/dokka/html
publish_branch: kdocs

View File

@@ -12,6 +12,7 @@ on:
jobs:
triage:
runs-on: ubuntu-latest
if: ${{ github.actor == github.repository_owner }}
steps:
- uses: actions/labeler@v2
with:

View File

@@ -0,0 +1,29 @@
name: Publish package to GitHub Packages
on: [push]
jobs:
publishing:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 11
- name: Rewrite version
run: |
branch="`echo "${{ github.ref }}" | grep -o "[^/]*$"`"
cat gradle.properties | sed -e "s/^library_version=\([0-9\.]*\)/library_version=\1-branch_$branch-build${{ github.run_number }}/" > gradle.properties.tmp
rm gradle.properties
mv gradle.properties.tmp gradle.properties
- name: Build
run: ./gradlew build
- name: Publish to Gitea
continue-on-error: true
run: ./gradlew publishAllPublicationsToGiteaRepository
env:
GITEA_TOKEN: ${{ secrets.GITEA_TOKEN }}
- name: Publish to GithubPackages
continue-on-error: true
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
env:
GITHUBPACKAGES_USER: ${{ github.actor }}
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -1 +0,0 @@
spellchecker: true

1
.gitignore vendored
View File

@@ -10,4 +10,5 @@ build/
out/
local.properties
kotlin-js-store/
secret.gradle

File diff suppressed because it is too large Load Diff

211
README.md
View File

@@ -1,137 +1,120 @@
# TelegramBotAPI
# TelegramBotAPI [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) [![Supported version](https://img.shields.io/badge/Telegram%20Bot%20API-6.3-blue)](https://core.telegram.org/bots/api-changelog#november-5-2022)
| Common info | [![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Build Status](https://travis-ci.com/InsanusMokrassar/TelegramBotAPI.svg?branch=master)](https://travis-ci.com/InsanusMokrassar/TelegramBotAPI) [Small survey](https://forms.gle/2Hex2ynbHWHhi1KY7)|
| -------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Useful links | [![Chat in Telegram](badges/chat.svg)](https://t.me/InMoTelegramBotAPI) [![KDocs](badges/kdocs.svg)](https://tgbotapi.inmo.dev/docs/index.html) [Examples](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/), [Mini tutorial](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
| TelegramBotAPI Core status | [![Download](https://api.bintray.com/packages/insanusmokrassar/TelegramBotAPI/tgbotapi.core/images/download.svg)](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.core/_latestVersion) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.core/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.core) |
| TelegramBotAPI Extensions status | [![Download](https://api.bintray.com/packages/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/images/download.svg)](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/_latestVersion) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api) |
| TelegramBotAPI Util Extensions status | [![Download](https://api.bintray.com/packages/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.utils/images/download.svg)](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.utils/_latestVersion) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.utils/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.utils) |
| TelegramBotAPI All status | [![Download](https://api.bintray.com/packages/insanusmokrassar/TelegramBotAPI/tgbotapi/images/download.svg)](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi/_latestVersion) [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) |
| Docs | [![KDocs](https://img.shields.io/static/v1?label=Dokka&message=KDocs&color=blue&logo=kotlin)](https://tgbotapi.inmo.dev/index.html) [![Mini tutorial](https://img.shields.io/static/v1?label=Bookstack&message=Tutorial&color=blue&logo=bookstack)](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
|:---:|:---:|
| Useful repos | [![Create bot](https://img.shields.io/static/v1?label=Github&message=Template&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [![Examples](https://img.shields.io/static/v1?label=Github&message=Examples&color=blue&logo=github)](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/) |
| Misc | [![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Small survey](https://img.shields.io/static/v1?label=Google&message=Survey&color=blue&logo=google-sheets)](https://docs.google.com/forms/d/e/1FAIpQLSctdJHT_aEniyYT0-IUAEfo1hsIlezX2owlkEAYX4KPl2V2_A/viewform?usp=sf_link) |
**At the time of publication of version `0.28.0` there are errors in serialization plugins like
[kotlinx.serialization#1004](https://github.com/Kotlin/kotlinx.serialization/issues/1004). It is possible, that both JVM
and JS version may work improperly in some cases with `kotlinx.serialization` version `1.0.0-RC`**
<!--- [![Telegram Channel](./resources/tg_channel_qr.jpg)](https://t.me/InMoTelegramBotAPI) --->
<p align="center">
<a href="https://t.me/InMoTelegramBotAPI">
<img src="./resources/tg_channel_qr.jpg">
</a>
</p>
It is a complex of libraries for working with `TelegramBotAPI` in type-safe and strict way as much as it possible. In
the list of this complex currently next projects:
Hello! This is a set of libraries for working with Telegram Bot API.
* [TelegramBotAPI Core](tgbotapi.core/README.md) - core of library. In fact it is independent library and can be used alone
without any additional library
* [TelegramBotAPI API Extensions](tgbotapi.extensions.api/README.md) - contains extensions (mostly for
`RequestsExecutor`), which allows to use the core library in more pleasant way
* [TelegramBotAPI Util Extensions](tgbotapi.extensions.utils/README.md) - contains extensions for more comfortable
work with commands, updates and other different things
* [TelegramBotAPI](tgbotapi/README.md) - concentration of all previously mentioned libraries
## Examples
Most part of some specific solves or unuseful
moments are describing by official [Telegram Bot API](https://core.telegram.org/bots/api).
There are several things you need to do to launch examples below:
## JavaScript notes
* Add `mavenCentral()` to your project repositories
* [Maven variant](https://github.com/InsanusMokrassar/TelegramBotAPI/wiki/Including-in-your-project#pomxml)
* Add dependency `implementation "dev.inmo:tgbotapi:$tgbotapi_version"`
* Replace `tgbotapi_version` with exact version (see last one in the table above) or put variable with this name in project
* Alternative variant for maven [here](https://github.com/InsanusMokrassar/TelegramBotAPI/wiki/Including-in-your-project#telegrambotapi)
### Versions before `0.28.0`
More including instructions [available here](https://github.com/InsanusMokrassar/TelegramBotAPI/wiki/Including-in-your-project).
Other configuration examples:
In case if you are want to use this library inside of browser, you will need additional settings (thanks for help to [Alexander Nozik](https://research.jetbrains.org/researchers/altavir)):
* [For multiplatform](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/tree/master/ResenderBot)
* [For JVM](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/blob/master/GetMeBot/build.gradle)
<details>
<summary>Gradle build script help (for versions before 0.28.0)</summary>
### Most common example
```groovy
dependencies {
/* ... */
```kotlin
suspend fun main() {
val bot = telegramBot(TOKEN)
implementation "com.github.insanusmokrassar:TelegramBotAPI:$tgbot_api_version"
implementation "com.github.insanusmokrassar:TelegramBotAPI-extensions-api:$tgbot_api_version" // optional
implementation "com.github.insanusmokrassar:TelegramBotAPI-extensions-utils:$tgbot_api_version" // optional
/* Block of dependencies for correct building in browser */
implementation(npm("fs"))
implementation(npm("bufferutil"))
implementation(npm("utf-8-validate"))
implementation(npm("abort-controller"))
implementation(npm("text-encoding"))
}
/* ... */
kotlin {
target {
browser {
/* Block for fix of exception in absence of some functionality, https://github.com/ktorio/ktor/issues/1339 */
dceTask {
dceOptions {
keep("ktor-ktor-io.\$\$importsForInline\$\$.ktor-ktor-io.io.ktor.utils.io")
}
}
}
bot.buildBehaviourWithLongPolling {
println(getMe())
onCommand("start") {
reply(it, "Hi:)")
}
}.join()
}
```
</details>
In this example you will see information about this bot at the moment of starting and answer with `Hi:)` every time it
gets message `/start`
## Ok, where should I start?
### Handling only last messages
![Libraries hierarchy](resources/TelegramBotAPI-libraries-hierarchy.svg)
```kotlin
suspend fun main() {
val bot = telegramBot(TOKEN)
In most cases, the most simple way will be to implement [TelegramBotAPI](tgbotapi/README.md) - it contains
all necessary tools for comfort usage of this library. If you want to exclude some libraries, you can implement just
[TelegramBotAPI API Extensions](tgbotapi.extensions.api/README.md),
[TelegramBotAPI Util Extensions](tgbotapi.extensions.utils/README.md) or even
[TelegramBotAPI Core](tgbotapi.core/README.md).
val flowsUpdatesFilter = FlowsUpdatesFilter()
bot.buildBehaviour(flowUpdatesFilter = flowsUpdatesFilter) {
println(getMe())
onCommand("start") {
reply(it, "Hi:)")
}
If you want to dive deeper in the core of library or develop something for it - welcome to learn more from
[TelegramBotAPI Core](tgbotapi.core/README.md) and our [Telegram Chat](https://teleg.one/InMoTelegramBotAPIChat).
Anyway, all libraries are very typical inside of them. Examples:
* In `TelegramBotAPI` common request look like `requestsExecutor.execute(SomeRequest())`
* `tgbotapi.extensions.api` typical syntax look like `requestsExecutor.someRequest()` (in most cases it would be
better to use `bot` name instead of `requestsExecutor`)
* `tgbotapi.extensions.utils` will look like `filter.filterBaseMessageUpdates(chatId).filterExactCommands(Regex("^.*$"))...`
## Build instruction
If you want to build this project or to contribute, there are several recommendations:
### Build
In case if you want to just build project, run next command:
```bash
./gradlew clean build
```
On windows:
```
gradlew.bat clean build
```
### Publishing for work with your version locally
In case, if you want to work in your other projects using your modification (or some state) of this library,
you can use next code:
```bash
./gradlew clean build publishToMavenLocal
```
On windows:
```
gradlew.bat clean build publishToMavenLocal
```
But you must remember, that in this case your local maven repo must be the first one from
your project retrieving libraries:
```groovy
repositories {
mavenLocal() // that must be the first one
jcenter()
mavenCentral()
retrieveAccumulatedUpdates(this).join()
}
}
```
Besides, for your own version you can change variable `library_version` in the file [gradle.properties](./gradle.properties).
The main difference with the previous example is that bot will get only last updates (accumulated before bot launch
and maybe some updates it got after launch)
### Build a little bit more complex behaviour
```kotlin
suspend fun main() {
val bot = telegramBot(TOKEN)
bot.buildBehaviourWithLongPolling {
println(getMe())
val nameReplyMarkup = ReplyKeyboardMarkup(
matrix {
row {
+SimpleKeyboardButton("nope")
}
}
)
onCommand("start") {
val photo = waitPhoto(
SendTextMessage(it.chat.id, "Send me your photo please")
).first()
val name = waitText(
SendTextMessage(
it.chat.id,
"Send me your name or choose \"nope\"",
replyMarkup = nameReplyMarkup
)
).first().text.takeIf { it != "nope" }
sendPhoto(
it.chat,
photo.mediaCollection,
entities = buildEntities {
if (name != null) regular(name) // may be collapsed up to name ?.let(::regular)
}
)
}
}.join()
}
```
### More examples
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
always welcome in our [bookstack](https://bookstack.inmo.dev/books/telegrambotapi) and
[chat](https://t.me/InMoTelegramBotAPIChat).

1
TelegramBotAPI.drawio Normal file

File diff suppressed because one or more lines are too long

View File

@@ -1,125 +0,0 @@
<?xml version="1.0"?>
<minder version="1.11.1">
<theme name="default" label="Default" index="-1"/>
<styles>
<style level="0" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="1" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="2" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="3" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="4" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="5" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="6" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="7" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="8" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="9" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<style level="10" isset="true" branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="200" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true" connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
</styles>
<drawarea x="-320.56697591145837" y="-10.028254191080691" scale="0.75"/>
<images/>
<nodes>
<node id="0" posx="748.88964843749955" posy="119.42341613769531" width="472" height="168" side="top" fold="false" treesize="603" layout="Downwards" group="false">
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="439" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
<nodename posx="764.88964843749955" posy="135.42341613769531" maxwidth="488.96484375">
<text data="tgbotapi.core&#10;&#10;Root project with API. It is not recommended to use its requests directly and better to use at least tgbotapi.extensions.api"/>
</nodename>
<nodenote></nodenote>
<nodes>
<node id="1" posx="781.88964843749955" posy="387.42341613769531" width="406" height="145" side="bottom" fold="false" treesize="603" color="#68b723" colorroot="true" layout="Downwards" group="false">
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="none" nodewidth="394" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
<nodename posx="797.88964843749955" posy="403.42341613769531" maxwidth="419.451171875">
<text data="TelegramBotAPI extensions&#10;&#10;Family of projects which are fully based on TelegramBotAPI and extend its functionality"/>
</nodename>
<nodenote></nodenote>
<nodes>
<node id="2" posx="683.38964843749955" posy="632.42341613769531" width="296" height="191" side="bottom" fold="false" treesize="296" color="#68b723" colorroot="true" layout="Downwards" group="false">
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="203" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
<nodename posx="699.38964843749955" posy="648.42341613769531" maxwidth="295.90315755208337">
<text data="tgbotapi.extensions.api&#10;&#10;Extensions project for make requests more look like in the Telegram Bot API and give opportunity to use it's easier"/>
</nodename>
<nodenote></nodenote>
</node>
<node id="3" posx="979.38964843749955" posy="632.42341613769531" width="307" height="168" side="bottom" fold="false" treesize="307" color="#68b723" colorroot="true" layout="Downwards" group="false">
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="286" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
<nodename posx="995.38964843749955" posy="648.42341613769531" maxwidth="299.252197265625">
<text data="tgbotapi.extensions.utils&#10;&#10;Extensions project with utils things which will make easier different operations"/>
</nodename>
<nodenote></nodenote>
</node>
</nodes>
</node>
</nodes>
</node>
<node id="4" posx="815.52319335937455" posy="948.04447937011719" width="329" height="213" side="top" fold="false" treesize="329" layout="Downwards" group="false">
<style branchmargin="100" linktype="curved" linkwidth="5" linkarrow="true" linkdash="solid" nodeborder="bracket" nodewidth="388" nodeborderwidth="3" nodefill="false" nodemargin="11" nodepadding="5" nodefont="Roboto Mono 14" nodemarkup="true"/>
<nodename posx="831.52319335937455" posy="964.04447937011719" maxwidth="394.3671875">
<text data="tgbotapi&#10;&#10;Here included all available TelegramBotAPI libraries:&#13;&#10;&#13;&#10;* tgbotapi.core&#13;&#10;* tgbotapi.extensions.api&#13;&#10;* tgbotapi.extensions.utils">
<color>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="67" end="68" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="84" end="85" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
<range start="111" end="112" extra="rgb(255,0,0)"/>
</color>
</text>
</nodename>
<nodenote></nodenote>
</node>
</nodes>
<groups/>
<connections>
<connection from_id="2" to_id="4" drag_x="905.70642089843705" drag_y="891.23394775390625" color="#777777">
<style connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<title></title>
<note></note>
</connection>
<connection from_id="3" to_id="4" drag_x="1056.456420898437" drag_y="885.48394775390625" color="#777777">
<style connectiondash="dotted" connectionlwidth="2" connectionarrow="fromto" connectionpadding="3" connectionfont="Sans 10" connectiontwidth="100"/>
<title></title>
<note></note>
</connection>
</connections>
<stickers/>
</minder>

View File

@@ -1,20 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<clipPath id="a">
<rect width="104" height="20" rx="3" fill="#fff"/>
</clipPath>
<g clip-path="url(#a)">
<path fill="#555" d="M0 0h65v20H0z"/>
<path fill="#007ec6" d="M35 0h69v20H35z"/>
<path fill="url(#b)" d="M0 0h104v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
<text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Talk</text>
<text x="175" y="140" transform="scale(.1)">Talk</text>
<text x="690" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Telegram</text>
<text x="690" y="140" transform="scale(.1)">Telegram</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1018 B

View File

@@ -1,20 +0,0 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="104" height="20">
<linearGradient id="b" x2="0" y2="100%">
<stop offset="0" stop-color="#bbb" stop-opacity=".1"/>
<stop offset="1" stop-opacity=".1"/>
</linearGradient>
<clipPath id="a">
<rect width="104" height="20" rx="3" fill="#fff"/>
</clipPath>
<g clip-path="url(#a)">
<path fill="#555" d="M0 0h65v20H0z"/>
<path fill="#007ec6" d="M45 0h69v20H45z"/>
<path fill="url(#b)" d="M0 0h104v20H0z"/>
</g>
<g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110">
<text x="225" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Open</text>
<text x="225" y="140" transform="scale(.1)">Open</text>
<text x="740" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">KDocs</text>
<text x="740" y="140" transform="scale(.1)">KDocs</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1012 B

View File

@@ -1,23 +1,36 @@
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "com.jfrog.bintray.gradle:gradle-bintray-plugin:$gradle_bintray_plugin_version"
classpath "com.github.breadmoirai:github-release:$github_release_plugin_version"
classpath libs.kotlin.gradle.plugin
classpath libs.kotlin.ksp.plugin
classpath libs.kotlin.serialization.plugin
classpath libs.kotlin.dokka.plugin
classpath libs.github.release.plugin
}
}
plugins {
id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version" apply false
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version" apply false
// temporal crutch until legacy tests will be stabled or legacy target will be removed
allprojects {
repositories {
mavenLocal()
mavenCentral()
google()
maven { url "https://git.inmo.dev/api/packages/InsanusMokrassar/maven" }
}
if (it != rootProject.findProject("docs")) {
tasks.whenTaskAdded { task ->
if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") {
task.enabled = false
}
}
}
}
apply from: "./extensions.gradle"
private String getCurrentVersionChangelog() {
OutputStream changelogDataOS = new ByteArrayOutputStream()
@@ -39,7 +52,7 @@ if (new File(projectDir, "secret.gradle").exists()) {
owner "InsanusMokrassar"
repo "TelegramBotAPI"
tagName "$library_version"
tagName "v$library_version"
releaseName "$library_version"
targetCommitish "$library_version"

View File

@@ -1,46 +1,28 @@
buildscript {
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
dependencies {
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
}
}
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
id "org.jetbrains.dokka" version "$dokka_version"
id "org.jetbrains.dokka"
}
repositories {
mavenLocal()
jcenter()
mavenCentral()
}
project.description = "Full collection of all built-in tgbotapi tools"
apply from: "$mppProjectWithSerializationPresetPath"
kotlin {
jvm()
js(BOTH) {
browser()
nodejs()
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
project.parent.subprojects.forEach {
if (it != project) {
api it
}
}
api project(":tgbotapi.core")
api project(":tgbotapi.api")
api project(":tgbotapi.utils")
api project(":tgbotapi.behaviour_builder")
api project(":tgbotapi.behaviour_builder.fsm")
api project(":tgbotapi")
}
}
jsMain {
dependencies {
api project(":tgbotapi.webapps")
}
}
}
@@ -48,15 +30,16 @@ kotlin {
private List<SourceDirectorySet> findSourcesWithName(String... approximateNames) {
return parent.subprojects
.findAll { it != project }
.collectMany { it.kotlin.sourceSets }
.findAll { sourceSet -> approximateNames.any {
nameToFilter -> sourceSet.name.contains(nameToFilter)
}
}.collect { it.kotlin }
.findAll { it != project && it.hasProperty("kotlin") }
.collectMany { it.kotlin.sourceSets }
.findAll { sourceSet ->
approximateNames.any { nameToFilter ->
sourceSet.name.contains(nameToFilter)
}
}.collect { it.kotlin }
}
tasks.dokkaHtml {
Object callback = {
switch (true) {
case project.hasProperty("DOKKA_PATH"):
outputDirectory = project.property("DOKKA_PATH").toString()
@@ -82,11 +65,14 @@ tasks.dokkaHtml {
}
named("jsMain") {
sourceRoots.setFrom(findSourcesWithName("jsMain", "commonMain"))
sourceRoots.setFrom(findSourcesWithName("jsMain"))
}
named("jvmMain") {
sourceRoots.setFrom(findSourcesWithName("jvmMain", "commonMain"))
sourceRoots.setFrom(findSourcesWithName("jvmMain"))
}
}
}
tasks.dokkaGfm(callback)
tasks.dokkaHtml(callback)

View File

@@ -1,3 +1 @@
dokka_version=1.4.0
org.gradle.jvmargs=-Xmx1024m

8
extensions.gradle Normal file
View File

@@ -0,0 +1,8 @@
allprojects {
ext {
mppProjectWithSerializationPresetPath = "${rootProject.projectDir.absolutePath}/mppProjectWithSerialization.gradle"
mppJsProjectPresetPath = "${rootProject.projectDir.absolutePath}/mppJsProject.gradle"
publishGradlePath = "${rootProject.projectDir.absolutePath}/publish.gradle"
}
}

View File

@@ -5,17 +5,5 @@ kotlin.js.generate.externals=true
kotlin.incremental=true
kotlin.incremental.js=true
kotlin_version=1.4.10
kotlin_coroutines_version=1.4.0
kotlin_serialisation_runtime_version=1.0.1
klock_version=1.12.1
uuid_version=0.2.2
ktor_version=1.4.1
javax_activation_version=1.1.1
library_group=dev.inmo
library_version=0.29.4
gradle_bintray_plugin_version=1.8.5
github_release_plugin_version=2.2.12
library_version=4.2.1

69
gradle/libs.versions.toml Normal file
View File

@@ -0,0 +1,69 @@
[versions]
kotlin = "1.7.22"
kotlin-serialization = "1.4.1"
kotlin-coroutines = "1.6.4"
javax-activation = "1.1.1"
korlibs = "3.4.0"
uuid = "0.6.0"
ktor = "2.2.1"
ksp = "1.7.22-1.0.8"
kotlin-poet = "1.12.0"
microutils = "0.16.0"
github-release-plugin = "2.4.1"
dokka = "1.7.20"
[libraries]
kotlin = { module = "org.jetbrains.kotlin:kotlin-stdlib", version.ref = "kotlin" }
kotlin-coroutines = { module = "org.jetbrains.kotlinx:kotlinx-coroutines-core", version.ref = "kotlin-coroutines" }
kotlin-serialization = { module = "org.jetbrains.kotlinx:kotlinx-serialization-json", version.ref = "kotlin-serialization" }
kotlin-serialization-properties = { module = "org.jetbrains.kotlinx:kotlinx-serialization-properties", version.ref = "kotlin-serialization" }
kotlin-test-common = { module = "org.jetbrains.kotlin:kotlin-test-common", version.ref = "kotlin" }
kotlin-test-annotations-common = { module = "org.jetbrains.kotlin:kotlin-test-annotations-common", version.ref = "kotlin" }
kotlin-test-junit = { module = "org.jetbrains.kotlin:kotlin-test-junit", version.ref = "kotlin" }
kotlin-test-js = { module = "org.jetbrains.kotlin:kotlin-test-js", version.ref = "kotlin" }
ktor-client-core = { module = "io.ktor:ktor-client-core", version.ref = "ktor" }
ktor-client-cio = { module = "io.ktor:ktor-client-cio", version.ref = "ktor" }
ktor-server = { module = "io.ktor:ktor-server", version.ref = "ktor" }
ktor-server-host-common = { module = "io.ktor:ktor-server-host-common", version.ref = "ktor" }
javax-activation = { module = "javax.activation:activation", version.ref = "javax-activation" }
korlibs-klock = { module = "com.soywiz.korlibs.klock:klock", version.ref = "korlibs" }
korlibs-krypto = { module = "com.soywiz.korlibs.krypto:krypto", version.ref = "korlibs" }
uuid = { module = "com.benasher44:uuid", version.ref = "uuid" }
microutils-coroutines = { module = "dev.inmo:micro_utils.coroutines", version.ref = "microutils" }
microutils-serialization-base64 = { module = "dev.inmo:micro_utils.serialization.base64", version.ref = "microutils" }
microutils-serialization-encapsulator = { module = "dev.inmo:micro_utils.serialization.encapsulator", version.ref = "microutils" }
microutils-serialization-typedSerializer = { module = "dev.inmo:micro_utils.serialization.typed_serializer", version.ref = "microutils" }
microutils-languageCodes = { module = "dev.inmo:micro_utils.language_codes", version.ref = "microutils" }
microutils-ktor-common = { module = "dev.inmo:micro_utils.ktor.common", version.ref = "microutils" }
microutils-fsm-common = { module = "dev.inmo:micro_utils.fsm.common", version.ref = "microutils" }
# ksp dependencies
kotlin-poet = { module = "com.squareup:kotlinpoet-ksp", version.ref = "kotlin-poet" }
ksp = { module = "com.google.devtools.ksp:symbol-processing-api", version.ref = "ksp" }
# buildscript classpaths
kotlin-gradle-plugin = { module = "org.jetbrains.kotlin:kotlin-gradle-plugin", version.ref = "kotlin" }
kotlin-ksp-plugin = { module = "com.google.devtools.ksp:symbol-processing-gradle-plugin", version.ref = "ksp" }
kotlin-serialization-plugin = { module = "org.jetbrains.kotlin:kotlin-serialization", version.ref = "kotlin" }
kotlin-dokka-plugin = { module = "org.jetbrains.dokka:dokka-gradle-plugin", version.ref = "dokka" }
github-release-plugin = { module = "com.github.breadmoirai:github-release", version.ref = "github-release-plugin" }
[plugins]
kotlin-jvm = { id = "org.jetbrains.kotlin.jvm", version.ref = "kotlin" }
kotlin-multiplatform = { id = "org.jetbrains.kotlin.multiplatform", version.ref = "kotlin" }
kotlin-serialization = { id = "org.jetbrains.kotlin.plugin.serialization", version.ref = "kotlin" }

View File

@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.6.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.6-bin.zip

32
mppJsProject.gradle Normal file
View File

@@ -0,0 +1,32 @@
project.version = "$version"
project.group = "$group"
apply from: "$publishGradlePath"
kotlin {
js (IR) {
browser()
nodejs()
}
sourceSets {
commonMain {
dependencies {
implementation libs.kotlin
api libs.kotlin.serialization
}
}
commonTest {
dependencies {
implementation libs.kotlin.test.common
implementation libs.kotlin.test.annotations.common
}
}
jsTest {
dependencies {
implementation libs.kotlin.test.js
implementation libs.kotlin.test.junit
}
}
}
}

View File

@@ -0,0 +1,47 @@
project.version = "$library_version"
project.group = "$library_group"
kotlin {
jvm {
compilations.main {
kotlinOptions {
jvmTarget = "1.8"
}
}
}
js (IR) {
browser()
nodejs()
}
sourceSets {
commonMain {
dependencies {
implementation libs.kotlin
api libs.kotlin.serialization
}
}
commonTest {
dependencies {
implementation libs.kotlin.test.common
implementation libs.kotlin.test.annotations.common
}
}
jvmTest {
dependencies {
implementation libs.kotlin.test.junit
}
}
jsTest {
dependencies {
implementation libs.kotlin.test.js
implementation libs.kotlin.test.junit
}
}
}
}
java {
sourceCompatibility = JavaVersion.VERSION_1_8
targetCompatibility = JavaVersion.VERSION_1_8
}

99
publish.gradle Normal file
View File

@@ -0,0 +1,99 @@
apply plugin: 'maven-publish'
task javadocsJar(type: Jar) {
classifier = 'javadoc'
}
publishing {
publications.all {
artifact javadocsJar
pom {
description = "${project.description}"
name = "${project.name}"
url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI"
scm {
developerConnection = "scm:git:[fetch=]https://github.com/insanusmokrassar/TelegramBotAPI.git[push=]https://github.com/insanusmokrassar/TelegramBotAPI.git"
url = "https://github.com/insanusmokrassar/TelegramBotAPI.git"
}
developers {
developer {
id = "InsanusMokrassar"
name = "Ovsiannikov Aleksei"
email = "ovsyannikov.alexey95@gmail.com"
}
}
licenses {
license {
name = "Apache Software License 2.0"
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"
}
}
}
repositories {
if ((project.hasProperty('GITHUBPACKAGES_USER') || System.getenv('GITHUBPACKAGES_USER') != null) && (project.hasProperty('GITHUBPACKAGES_PASSWORD') || System.getenv('GITHUBPACKAGES_PASSWORD') != null)) {
maven {
name = "GithubPackages"
url = uri("https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI")
credentials {
username = project.hasProperty('GITHUBPACKAGES_USER') ? project.property('GITHUBPACKAGES_USER') : System.getenv('GITHUBPACKAGES_USER')
password = project.hasProperty('GITHUBPACKAGES_PASSWORD') ? project.property('GITHUBPACKAGES_PASSWORD') : System.getenv('GITHUBPACKAGES_PASSWORD')
}
}
}
if (project.hasProperty('GITEA_TOKEN') || System.getenv('GITEA_TOKEN') != null) {
maven {
name = "Gitea"
url = uri("https://git.inmo.dev/api/packages/InsanusMokrassar/maven")
credentials(HttpHeaderCredentials) {
name = "Authorization"
value = project.hasProperty('GITEA_TOKEN') ? project.property('GITEA_TOKEN') : System.getenv('GITEA_TOKEN')
}
authentication {
header(HttpHeaderAuthentication)
}
}
}
if ((project.hasProperty('SONATYPE_USER') || System.getenv('SONATYPE_USER') != null) && (project.hasProperty('SONATYPE_PASSWORD') || System.getenv('SONATYPE_PASSWORD') != null)) {
maven {
name = "sonatype"
url = uri("https://oss.sonatype.org/service/local/staging/deploy/maven2/")
credentials {
username = project.hasProperty('SONATYPE_USER') ? project.property('SONATYPE_USER') : System.getenv('SONATYPE_USER')
password = project.hasProperty('SONATYPE_PASSWORD') ? project.property('SONATYPE_PASSWORD') : System.getenv('SONATYPE_PASSWORD')
}
}
}
}
}
}
if (project.hasProperty("signing.gnupg.keyName")) {
apply plugin: 'signing'
signing {
useGpgCmd()
sign publishing.publications
}
task signAll {
tasks.withType(Sign).forEach {
dependsOn(it)
}
}
}

1
publish.kpsb Normal file
View File

@@ -0,0 +1 @@
{"licenses":[{"id":"Apache-2.0","title":"Apache Software License 2.0","url":"https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/LICENSE"}],"mavenConfig":{"name":"${project.name}","description":"${project.description}","url":"https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI","vcsUrl":"https://github.com/insanusmokrassar/TelegramBotAPI.git","developers":[{"id":"InsanusMokrassar","name":"Ovsiannikov Aleksei","eMail":"ovsyannikov.alexey95@gmail.com"}],"repositories":[{"name":"GithubPackages","url":"https://maven.pkg.github.com/InsanusMokrassar/TelegramBotAPI"},{"name":"Gitea","url":"https://git.inmo.dev/api/packages/InsanusMokrassar/maven","credsType":{"type":"dev.inmo.kmppscriptbuilder.core.models.MavenPublishingRepository.CredentialsType.HttpHeaderCredentials","headerName":"Authorization","headerValueProperty":"GITEA_TOKEN"}},{"name":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}

View File

@@ -0,0 +1,97 @@
# Exceptions handling
Unfortunatelly, exceptions handling in this library is a bit difficult in some places, but that have at least two reasons: flexibility and usability.
## "In place" handling
In case you know, where exceptions are happening, you may use several tools for exceptions catching:
* Catching with result
* Catching with callback
### Catching with result
If you prefer to receive `Result` objects instead of some weird callbacks, you may use the next syntax:
```kotlin
safelyWithResult {
// do something
}.onSuccess { // will be called if everything is right
// handle success
}.onFailure { // will be called if something went wrong
// handle error
it.printStackTrace()
}.getOrThrow() // will return value or throw exception
```
### Catching with callback
Also there is more simple (in some cases) way to handle exceptions with callbacks:
```kotlin
safely(
{
// handle error
it.printStackTrace()
null // return value
}
) {
// do something
}
```
### Bonus: different types of handling
There are two types of handling:
* Just safely - when you are using something to obviously retrieve value or throw exception. When handling callback has been skipped, it will throw exception by default. For example:
```kotlin
safely(
{
it.printStackTrace()
"error"
}
) {
error("Hi :)") // emulate exception throwing
"ok"
} // result will be with type String
```
* Safely without exceptions - almost the same as `safely`, but this type by default allow to return nullable value (when exception was thrown) instead of just throwing (as with `safely`):
```kotlin
safelyWithouExceptions {
// do something
} // will returns nullable result type
```
## Global exceptions handling
The most simple way to configure exceptions handling is to change `CoroutineContext` when you are creating your `CoroutineScope` for bot processing:
```kotlin
val bot = telegramBot("TOKEN")
bot.buildBehaviour (
scope = scope,
defaultExceptionsHandler = {
it.printStackTrace()
}
) {
// ...
}
```
OR
```kotlin
val bot = telegramBotWithBehaviour (
"TOKEN",
scope = scope,
defaultExceptionsHandler = {
it.printStackTrace()
}
) {
// ...
}
```
Here we have used `ContextSafelyExceptionHandler` class. It will pass default handling of exceptions and will call the block in most cases when something inside of your bot logic has thrown exception.

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 16 KiB

BIN
resources/tg_channel_qr.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

View File

@@ -1,12 +1,22 @@
pluginManagement {
resolutionStrategy {
eachPlugin {
if (requested.id.id == "org.jetbrains.dokka") {
useModule("org.jetbrains.dokka:dokka-gradle-plugin:${requested.version}")
}
}
}
repositories {
gradlePluginPortal()
jcenter()
}
}
include ":tgbotapi.core"
include ":tgbotapi.extensions.api"
include ":tgbotapi.extensions.utils"
include ":tgbotapi.ksp"
include ":tgbotapi.api"
include ":tgbotapi.utils"
include ":tgbotapi.behaviour_builder"
include ":tgbotapi.behaviour_builder.fsm"
include ":tgbotapi"
include ":tgbotapi.webapps"
include ":docs"

View File

@@ -1,7 +1,6 @@
# TelegramBotAPI extensions
# TelegramBotAPI API extensions
[![Download](https://api.bintray.com/packages/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/images/download.svg) ](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/_latestVersion)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.api)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api)
## What is it?
@@ -17,10 +16,9 @@ This library always compatible with original `tgbotapi.core` library version
Common ways to implement this library are presented here. In some cases it will require additional steps
like inserting of additional libraries (like `kotlin stdlib`). In the examples will be used variable
`telegrambotapi-extensions-api.version`, which must be set up by developer. Available versions are presented on
[bintray](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api), next version is last published:
`telegrambotapi-extensions-api.version`, which must be set up by developer.
[![Download](https://api.bintray.com/packages/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/images/download.svg) ](https://bintray.com/insanusmokrassar/TelegramBotAPI/tgbotapi.extensions.api/_latestVersion)
[![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.api)
### Maven
@@ -29,7 +27,7 @@ Dependency config presented here:
```xml
<dependency>
<groupId>dev.inmo</groupId>
<artifactId>tgbotapi.extensions.api</artifactId>
<artifactId>tgbotapi.api</artifactId>
<version>${telegrambotapi-extensions-api.version}</version>
</dependency>
```
@@ -38,18 +36,18 @@ Dependency config presented here:
To use last versions you will need to add one line in repositories block of your `build.gradle`:
`jcenter()` or `mavenCentral()`
`mavenCentral()`
And add next line to your dependencies block:
```groovy
implementation "dev.inmo:tgbotapi.extensions.api:$telegrambotapi_extensions_api_version"
implementation "dev.inmo:tgbotapi.api:$telegrambotapi_extensions_api_version"
```
or for old gradle:
```groovy
compile "dev.inmo:tgbotapi.extensions.api:$telegrambotapi_extensions_api_version"
compile "dev.inmo:tgbotapi.api:$telegrambotapi_extensions_api_version"
```
## Example of usage and comparison with `TelegramBotAPI`
@@ -71,7 +69,7 @@ val bot = telegramBot("IT IS YOUR TOKEN") {
In all examples supposed that you have created bot.
| tgbotapi.core | tgbotapi.extensions.api |
| tgbotapi.core | tgbotapi.api |
|---------------------|-------------------------------|
| bot.execute(GetMe) | bot.getMe() |
| bot.execute(SendTextMessage(someChatId, text)) | bot.sendTextMessage(chat, text) |
@@ -79,8 +77,8 @@ In all examples supposed that you have created bot.
## Updates
**Currently, these paragraphs almost outdated due to the fact that extensions for listening of updates and webhooks were
replaced into `tgbotapi.extensions.utils`. But, most part of information below is correct with small fixes and
adding of `tgbotapi.extensions.utils` dependency.**
replaced into `tgbotapi.utils`. But, most part of information below is correct with small fixes and
adding of `tgbotapi.utils` dependency.**
Usually, it is more comfortable to use filter object to get separated types of updates:

20
tgbotapi.api/build.gradle Normal file
View File

@@ -0,0 +1,20 @@
plugins {
id "org.jetbrains.kotlin.multiplatform"
id "org.jetbrains.kotlin.plugin.serialization"
}
project.description = "API extensions with \"Telegram Bot API\"-like extensions for TelegramBot and RequestsExecutor"
apply from: "$mppProjectWithSerializationPresetPath"
apply from: "$publishGradlePath"
kotlin {
sourceSets {
commonMain {
dependencies {
api project(":tgbotapi.core")
}
}
}
}

View File

@@ -2,6 +2,7 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.*
@@ -36,10 +37,12 @@ data class BotBuilder internal constructor(
* @return Created by [telegramBotWithCustomClientConfig] function [TelegramBot]. This executor will be preconfigured using [token] and
* [block]
*/
fun telegramBot(
fun buildBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
block: BotBuilder.() -> Unit
): TelegramBot = telegramBot(
TelegramAPIUrlsKeeper(token),
) = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
BotBuilder().apply(block).createHttpClient()
)

View File

@@ -0,0 +1,116 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.ktor.telegramBot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.utils.TelegramAPIUrlsKeeper
import dev.inmo.tgbotapi.utils.telegramBotAPIDefaultUrl
import io.ktor.client.HttpClient
import io.ktor.client.HttpClientConfig
import io.ktor.client.engine.*
/**
* Allows to create bot using bot [urlsKeeper] and already prepared [client]
*/
fun telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper,
client: HttpClient = HttpClient()
): TelegramBot = telegramBot(urlsKeeper) {
this.client = client
}
/**
* Allows to create bot using bot [urlsKeeper] and specify [HttpClientEngineFactory] by passing [clientFactory] param and optionally
* configure it with [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
inline fun <T: HttpClientEngineConfig> telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper,
clientFactory: HttpClientEngineFactory<T>,
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
) = telegramBot(
urlsKeeper,
HttpClient(clientFactory, clientConfig)
)
/**
* Allows to create bot using bot [urlsKeeper] and specify [HttpClientEngine] by passing [clientEngine] param and optionally
* configure [HttpClient] using [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
inline fun telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper,
clientEngine: HttpClientEngine,
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
) = telegramBot(
urlsKeeper,
HttpClient(clientEngine, clientConfig)
)
/**
* Allows to create bot using bot [urlsKeeper] and specify [HttpClientEngine] by configuring [HttpClient] using
* [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
inline fun telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper,
noinline clientConfig: HttpClientConfig<*>.() -> Unit
) = telegramBot(
urlsKeeper,
HttpClient(clientConfig)
)
/**
* Allows to create bot using bot [token], [apiUrl] (for custom api servers) and already prepared [client]
*/
@Suppress("NOTHING_TO_INLINE")
inline fun telegramBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
client: HttpClient = HttpClient()
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, testServer, apiUrl), client)
@Suppress("NOTHING_TO_INLINE")
inline fun <T: HttpClientEngineConfig> telegramBot(
token: String,
clientFactory: HttpClientEngineFactory<T>,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<T>.() -> Unit = {}
) = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
clientFactory,
clientConfig
)
/**
* Allows to create bot using bot [token] and specify [HttpClientEngine] by passing [clientEngine] param and optionally
* configure [HttpClient] using [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
inline fun telegramBot(
token: String,
clientEngine: HttpClientEngine,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
) = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
clientEngine,
clientConfig
)
/**
* Allows to create bot using bot [token] and [apiUrl] and specify [HttpClientEngine] by configuring [HttpClient] using
* [clientConfig]
*/
@Suppress("NOTHING_TO_INLINE")
inline fun telegramBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit
) = telegramBot(
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
clientConfig
)

View File

@@ -0,0 +1,7 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.local.Close
@Suppress("unused")
suspend inline fun TelegramBot.close() = execute(Close)

View File

@@ -3,26 +3,40 @@ package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.DeleteMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
suspend fun TelegramBot.deleteMessage(
chatId: ChatIdentifier,
messageId: MessageIdentifier
messageId: MessageId
) = execute(
DeleteMessage(chatId, messageId)
)
suspend fun TelegramBot.deleteMessage(
chat: Chat,
messageId: MessageIdentifier
messageId: MessageId
) = deleteMessage(chat.id, messageId)
suspend fun TelegramBot.deleteMessage(
message: Message
) = deleteMessage(message.chat, message.messageId)
suspend fun TelegramBot.delete(
chatId: ChatIdentifier,
messageId: MessageId
) = deleteMessage(chatId, messageId)
suspend fun TelegramBot.delete(
chat: Chat,
messageId: MessageId
) = deleteMessage(chat, messageId)
suspend fun TelegramBot.delete(
message: Message
) = deleteMessage(message)
suspend fun Message.delete(
requestsExecutor: TelegramBot
) = requestsExecutor.deleteMessage(this)

View File

@@ -0,0 +1,64 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.ForwardMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.threadId
suspend fun TelegramBot.forwardMessage(
fromChatId: ChatIdentifier,
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = execute(
ForwardMessage(fromChatId, toChatId, messageId, threadId, disableNotification, protectContent)
)
suspend fun TelegramBot.forwardMessage(
fromChat: Chat,
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = forwardMessage(fromChat.id, toChatId, messageId, threadId, disableNotification, protectContent)
suspend fun TelegramBot.forwardMessage(
fromChatId: ChatIdentifier,
toChat: Chat,
messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = forwardMessage(fromChatId, toChat.id, messageId, threadId, disableNotification, protectContent)
suspend fun TelegramBot.forwardMessage(
fromChat: Chat,
toChat: Chat,
messageId: MessageId,
threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = forwardMessage(fromChat.id, toChat.id, messageId, threadId, disableNotification, protectContent)
suspend fun TelegramBot.forwardMessage(
toChatId: ChatIdentifier,
message: Message,
threadId: MessageThreadId? = toChatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = forwardMessage(message.chat, toChatId, message.messageId, threadId, disableNotification, protectContent)
suspend fun TelegramBot.forwardMessage(
toChat: Chat,
message: Message,
threadId: MessageThreadId? = toChat.id.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)

View File

@@ -0,0 +1,57 @@
package dev.inmo.tgbotapi.extensions.api.InternalUtils
import dev.inmo.tgbotapi.types.MediaGroupIdentifier
import dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage
import dev.inmo.tgbotapi.types.message.content.MediaGroupPartContent
import dev.inmo.tgbotapi.types.update.*
import dev.inmo.tgbotapi.types.update.abstracts.*
import dev.inmo.tgbotapi.utils.extensions.asMediaGroupMessage
/**
* Will convert incoming list of updates to list with [MediaGroupUpdate]s
*/
internal fun List<Update>.convertWithMediaGroupUpdates(): List<Update> {
val resultUpdates = mutableListOf<Update>()
val mediaGroups = mutableMapOf<MediaGroupIdentifier, MutableList<Pair<BaseSentMessageUpdate, PossiblySentViaBotCommonMessage<MediaGroupPartContent>>>>()
for (update in this) {
val message = (update.data as? PossiblySentViaBotCommonMessage<*>) ?.let {
if (it.content is MediaGroupPartContent) {
it as PossiblySentViaBotCommonMessage<MediaGroupPartContent>
} else {
null
}
}
val mediaGroupId = message ?.mediaGroupId
if (message == null || mediaGroupId == null) {
resultUpdates.add(update)
continue
}
when (update) {
is BaseSentMessageUpdate -> {
mediaGroups.getOrPut(mediaGroupId) {
mutableListOf()
}.add(update to message)
}
else -> resultUpdates.add(update)
}
}
mediaGroups.map { (_, updatesWithMessages) ->
val update = updatesWithMessages.maxBy { it.first.updateId }.first
resultUpdates.add(
update.copy(updatesWithMessages.map { it.second }.asMediaGroupMessage())
)
}
resultUpdates.sortBy { it.updateId }
return resultUpdates
}
/**
* @return [EditMessageMediaGroupUpdate] in case if [this] is [EditMessageUpdate]. When [this] object is
* [EditChannelPostUpdate] instance - will return [EditChannelPostMediaGroupUpdate]
*
* @throws IllegalStateException
*/
internal fun BaseEditMessageUpdate.toEditMediaGroupUpdate() = this

View File

@@ -0,0 +1,159 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.micro_utils.coroutines.LinkedSupervisorJob
import dev.inmo.micro_utils.coroutines.launchSafelyWithoutExceptions
import dev.inmo.tgbotapi.abstracts.*
import dev.inmo.tgbotapi.abstracts.types.WithReplyMarkup
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.api.edit.edit
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
import dev.inmo.tgbotapi.extensions.api.send.send
import dev.inmo.tgbotapi.extensions.api.send.sendLiveLocation
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.Location
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
import kotlinx.coroutines.*
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.map
import kotlinx.serialization.Serializable
import kotlin.js.JsName
import kotlin.jvm.JvmName
import kotlin.math.ceil
@Serializable
data class EditLiveLocationInfo(
override val latitude: Double,
override val longitude: Double,
override val horizontalAccuracy: Meters? = null,
override val heading: Degrees? = null,
override val proximityAlertRadius: Meters? = null,
override val replyMarkup: InlineKeyboardMarkup? = null
) : Locationed, HorizontallyAccured, ProximityAlertable, Headed, WithReplyMarkup
/**
* Will [sendLiveLocation] with the first [EditLiveLocationInfo] data and update than. Each [liveTimeMillis] passing,
* the message will be sent again and new edits will be applied to the new message
*/
suspend fun TelegramBot.handleLiveLocation(
chatId: ChatIdentifier,
locationsFlow: Flow<EditLiveLocationInfo>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null
) {
var currentLiveLocationMessage: ContentMessage<LocationContent>? = null
val updateMessageJob = CoroutineScope(currentCoroutineContext().LinkedSupervisorJob()).launchSafelyWithoutExceptions(start = CoroutineStart.LAZY) {
while (isActive) {
delay(liveTimeMillis)
// Remove previous location message info to resend live location message
currentLiveLocationMessage = null
}
}
locationsFlow.collect {
val capturedLiveLocationMessage = currentLiveLocationMessage
if (capturedLiveLocationMessage == null) {
updateMessageJob.start()
currentLiveLocationMessage = send(
chatId,
it.latitude,
it.longitude,
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
it.horizontalAccuracy,
it.heading,
it.proximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
it.replyMarkup
)
} else {
edit(
capturedLiveLocationMessage,
it.latitude,
it.longitude,
it.horizontalAccuracy,
it.heading,
it.proximityAlertRadius,
it.replyMarkup
)
}
}
}
/**
* Will apply [Flow.map] to the [locationsFlow] to create [EditLiveLocationInfo] and pass the result flow to the
* [handleLiveLocation] with [Flow] typed by [EditLiveLocationInfo]
*/
@JvmName("handleLiveLocationWithLocation")
@JsName("handleLiveLocationWithLocation")
suspend fun TelegramBot.handleLiveLocation(
chatId: ChatIdentifier,
locationsFlow: Flow<Location>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null
) {
handleLiveLocation(
chatId,
locationsFlow.map {
EditLiveLocationInfo(
it.latitude,
it.longitude,
it.horizontalAccuracy,
(it as? LiveLocation) ?.heading,
(it as? LiveLocation) ?.proximityAlertRadius,
(it as? WithReplyMarkup) ?.replyMarkup as? InlineKeyboardMarkup
)
},
liveTimeMillis,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply
)
}
/**
* Will apply [Flow.map] to the [locationsFlow] to create [EditLiveLocationInfo] and pass the result flow to the
* [handleLiveLocation] with [Flow] typed by [EditLiveLocationInfo]
*/
@JvmName("handleLiveLocationWithLatLong")
@JsName("handleLiveLocationWithLatLong")
suspend fun TelegramBot.handleLiveLocation(
chatId: ChatIdentifier,
locationsFlow: Flow<Pair<Double, Double>>,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null
) {
handleLiveLocation(
chatId,
locationsFlow.map { (lat, long) ->
EditLiveLocationInfo(
lat,
long
)
},
liveTimeMillis,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply
)
}

View File

@@ -0,0 +1,300 @@
package dev.inmo.tgbotapi.extensions.api
import com.soywiz.klock.DateTime
import com.soywiz.klock.TimeSpan
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
import dev.inmo.tgbotapi.extensions.api.edit.location.live.stopLiveLocation
import dev.inmo.tgbotapi.requests.send.SendLiveLocation
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.location.StaticLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.content.LocationContent
import dev.inmo.tgbotapi.utils.extensions.threadIdOrNull
import io.ktor.utils.io.core.Closeable
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.launch
import kotlin.math.ceil
val defaultLivePeriodDelayMillis = (livePeriodLimit.last - 60L) * 1000L
/**
* @see startLiveLocation
*/
class LiveLocationProvider internal constructor(
private val requestsExecutor: TelegramBot,
scope: CoroutineScope,
autoCloseTimeDelay: Double,
initMessage: ContentMessage<LocationContent>
) : Closeable {
private val doWhenClose = {
scope.launch {
requestsExecutor.stopLiveLocation(message)
}
}
private val autoCloseTime = DateTime.now() + TimeSpan(autoCloseTimeDelay)
val leftUntilCloseMillis: TimeSpan
get() = autoCloseTime - DateTime.now()
var isClosed: Boolean = false
private set
get() = field || leftUntilCloseMillis.millisecondsLong < 0L
private var message: ContentMessage<LocationContent> = initMessage
val lastLocation: LiveLocation
get() = message.content.location as LiveLocation
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun updateLocation(
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
): LiveLocation {
if (!isClosed) {
message = requestsExecutor.editLiveLocation(
message,
location,
replyMarkup
)
return lastLocation
} else {
error("LiveLocation is closed")
}
}
override fun close() {
if (isClosed) {
return
}
isClosed = true
doWhenClose()
}
}
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.startLiveLocation(
scope: CoroutineScope,
chatId: ChatIdentifier,
latitude: Double,
longitude: Double,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider {
val liveTimeAsDouble = liveTimeMillis.toDouble()
val locationMessage = execute(
SendLiveLocation(
chatId,
latitude,
longitude,
ceil(liveTimeAsDouble / 1000).toInt(),
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
)
)
return LiveLocationProvider(
this,
scope,
liveTimeAsDouble,
locationMessage
)
}
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.startLiveLocation(
scope: CoroutineScope,
chat: Chat,
latitude: Double,
longitude: Double,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
scope,
chat.id,
latitude,
longitude,
liveTimeMillis,
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.startLiveLocation(
scope: CoroutineScope,
chatId: IdChatIdentifier,
location: StaticLocation,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chatId.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
scope,
chatId,
location.latitude,
location.longitude,
liveTimeMillis,
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend fun TelegramBot.startLiveLocation(
scope: CoroutineScope,
chat: Chat,
location: StaticLocation,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = chat.id.threadId,
disableNotification: Boolean = false,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
scope,
chat.id,
location.latitude,
location.longitude,
liveTimeMillis,
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend inline fun TelegramBot.replyWithLiveLocation(
to: Message,
scope: CoroutineScope,
latitude: Double,
longitude: Double,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = startLiveLocation(
scope,
to.chat,
latitude,
longitude,
liveTimeMillis,
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
to.messageId,
allowSendingWithoutReply,
replyMarkup
)
/**
* @param replyMarkup Some of [KeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.replyKeyboard] or
* [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard] as a builders for that param
*/
suspend inline fun TelegramBot.replyWithLiveLocation(
to: Message,
scope: CoroutineScope,
location: StaticLocation,
liveTimeMillis: Long = defaultLivePeriodDelayMillis,
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = to.threadIdOrNull,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = startLiveLocation(
scope,
to.chat,
location,
liveTimeMillis,
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
to.messageId,
allowSendingWithoutReply,
replyMarkup
)

View File

@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.local.LogOut
suspend inline fun TelegramBot.logOut() = execute(LogOut)

View File

@@ -4,29 +4,45 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.StopPoll
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopPoll(
chatId: ChatIdentifier,
messageId: MessageIdentifier,
messageId: MessageId,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
StopPoll(chatId, messageId, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopPoll(
chat: Chat,
messageId: MessageIdentifier,
messageId: MessageId,
replyMarkup: InlineKeyboardMarkup? = null
) = stopPoll(chat.id, messageId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopPoll(
chatId: ChatId,
chatId: IdChatIdentifier,
message: Message,
replyMarkup: InlineKeyboardMarkup? = null
) = stopPoll(chatId, message.messageId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopPoll(
chat: Chat,
message: Message,

View File

@@ -2,7 +2,7 @@ package dev.inmo.tgbotapi.extensions.api.answers
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.answers.AnswerCallbackQuery
import dev.inmo.tgbotapi.types.CallbackQuery.CallbackQuery
import dev.inmo.tgbotapi.types.queries.callback.CallbackQuery
import dev.inmo.tgbotapi.types.CallbackQueryIdentifier
suspend fun TelegramBot.answerCallbackQuery(
@@ -20,3 +20,11 @@ suspend fun TelegramBot.answerCallbackQuery(
url: String? = null,
cachedTimeSeconds: Int? = null
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)
suspend fun TelegramBot.answer(
callbackQuery: CallbackQuery,
text: String? = null,
showAlert: Boolean? = null,
url: String? = null,
cachedTimeSeconds: Int? = null
) = answerCallbackQuery(callbackQuery.id, text, showAlert, url, cachedTimeSeconds)

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.answers
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.answers.AnswerInlineQuery
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
import dev.inmo.tgbotapi.types.InlineQueries.abstracts.InlineQuery
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
suspend fun TelegramBot.answerInlineQuery(
@@ -27,3 +27,13 @@ suspend fun TelegramBot.answerInlineQuery(
switchPmText: String? = null,
switchPmParameter: String? = null
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)
suspend fun TelegramBot.answer(
inlineQuery: InlineQuery,
results: List<InlineQueryResult> = emptyList(),
cachedTime: Int? = null,
isPersonal: Boolean? = null,
nextOffset: String? = null,
switchPmText: String? = null,
switchPmParameter: String? = null
) = answerInlineQuery(inlineQuery.id, results, cachedTime, isPersonal, nextOffset, switchPmText, switchPmParameter)

View File

@@ -0,0 +1,16 @@
package dev.inmo.tgbotapi.extensions.api.answers
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.answers.AnswerWebAppQuery
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.InlineQueryResult
import dev.inmo.tgbotapi.types.WebAppQueryId
suspend fun TelegramBot.answerWebAppQuery(
webAppQueryId: WebAppQueryId,
result: InlineQueryResult
) = execute(AnswerWebAppQuery(webAppQueryId, result))
suspend fun TelegramBot.answer(
webAppQueryId: WebAppQueryId,
result: InlineQueryResult
) = execute(AnswerWebAppQuery(webAppQueryId, result))

View File

@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.ClearMyDefaultAdministratorRights
suspend fun TelegramBot.clearMyDefaultAdministratorRights(
forChannels: Boolean? = null
) = execute(ClearMyDefaultAdministratorRights(forChannels))
suspend fun TelegramBot.clearMyDefaultAdministratorRightsForChannels() = clearMyDefaultAdministratorRights(forChannels = true)
suspend fun TelegramBot.clearMyDefaultAdministratorRightsForGroupsAndSupergroups() = clearMyDefaultAdministratorRights(forChannels = false)

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.DeleteMyCommands
import dev.inmo.tgbotapi.types.commands.BotCommandScope
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
suspend fun TelegramBot.deleteMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLanguageCode?
) = execute(DeleteMyCommands(scope, languageCode))
suspend fun TelegramBot.deleteMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
) = deleteMyCommands(scope, languageCode ?.let(::IetfLanguageCode))

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.GetMyCommands
import dev.inmo.tgbotapi.types.commands.BotCommandScope
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
suspend fun TelegramBot.getMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLanguageCode? = null
) = execute(GetMyCommands(scope, languageCode))
suspend fun TelegramBot.getMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String?
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))

View File

@@ -0,0 +1,12 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.GetMyDefaultAdministratorRights
suspend fun TelegramBot.getMyDefaultAdministratorRights(
forChannels: Boolean? = null
) = execute(GetMyDefaultAdministratorRights(forChannels))
suspend fun TelegramBot.getMyDefaultAdministratorRightsForChannels() = getMyDefaultAdministratorRights(forChannels = true)
suspend fun TelegramBot.getMyDefaultAdministratorRightsForGroupsAndSupergroups() = getMyDefaultAdministratorRights(forChannels = false)

View File

@@ -0,0 +1,32 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.micro_utils.language_codes.IetfLanguageCode
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.SetMyCommands
import dev.inmo.tgbotapi.types.BotCommand
import dev.inmo.tgbotapi.types.commands.BotCommandScope
import dev.inmo.tgbotapi.types.commands.BotCommandScopeDefault
suspend fun TelegramBot.setMyCommands(
commands: List<BotCommand>,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLanguageCode?
) = execute(SetMyCommands(commands, scope, languageCode))
suspend fun TelegramBot.setMyCommands(
vararg commands: BotCommand,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: IetfLanguageCode?
) = setMyCommands(commands.toList(), scope, languageCode)
suspend fun TelegramBot.setMyCommands(
commands: List<BotCommand>,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
) = setMyCommands(commands, scope, languageCode ?.let(::IetfLanguageCode))
suspend fun TelegramBot.setMyCommands(
vararg commands: BotCommand,
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
) = setMyCommands(commands.toList(), scope, languageCode)

View File

@@ -0,0 +1,18 @@
package dev.inmo.tgbotapi.extensions.api.bot
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.bot.SetMyDefaultAdministratorRights
import dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl
suspend fun TelegramBot.setMyDefaultAdministratorRights(
rights: ChatAdministratorRightsImpl,
forChannels: Boolean? = null
) = execute(SetMyDefaultAdministratorRights(rights, forChannels))
suspend fun TelegramBot.setMyDefaultAdministratorRightsForChannels(
rights: ChatAdministratorRightsImpl
) = setMyDefaultAdministratorRights(rights, forChannels = true)
suspend fun TelegramBot.setMyDefaultAdministratorRightsForGroupsAndSupergroups(
rights: ChatAdministratorRightsImpl
) = setMyDefaultAdministratorRights(rights, forChannels = false)

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.ExportChatInviteLink
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.exportChatInviteLink(
chatId: ChatIdentifier

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.LeaveChat
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.leaveChat(
chatId: ChatIdentifier

View File

@@ -0,0 +1,28 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.CloseForumTopic
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ForumTopic
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.closeForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
) = execute(
CloseForumTopic(
chatId,
messageThreadId
)
)
suspend fun TelegramBot.closeForumTopic(
chat: Chat,
messageThreadId: MessageThreadId
) = closeForumTopic(chat.id, messageThreadId)
suspend fun TelegramBot.closeForumTopic(
chat: Chat,
forumTopic: ForumTopic
) = closeForumTopic(chat.id, forumTopic.messageThreadId)

View File

@@ -0,0 +1,29 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.CreateForumTopic
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.CustomEmojiId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.utils.RGBColor
suspend fun TelegramBot.createForumTopic(
chatId: ChatIdentifier,
name: String,
color: RGBColor,
iconEmojiId: CustomEmojiId? = null
) = execute(
CreateForumTopic(
chatId,
name,
color,
iconEmojiId
)
)
suspend fun TelegramBot.createForumTopic(
chat: Chat,
name: String,
color: RGBColor,
iconEmojiId: CustomEmojiId? = null
) = createForumTopic(chat.id, name, color, iconEmojiId)

View File

@@ -0,0 +1,33 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.DeleteForumTopic
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ForumTopic
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.deleteForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
) = execute(
DeleteForumTopic(
chatId,
messageThreadId
)
)
suspend fun TelegramBot.deleteForumTopic(
chatId: ChatIdentifier,
forumTopic: ForumTopic
) = deleteForumTopic(chatId, forumTopic.messageThreadId)
suspend fun TelegramBot.deleteForumTopic(
chat: Chat,
messageThreadId: MessageThreadId
) = deleteForumTopic(chat.id, messageThreadId)
suspend fun TelegramBot.deleteForumTopic(
chat: Chat,
forumTopic: ForumTopic
) = deleteForumTopic(chat.id, forumTopic.messageThreadId)

View File

@@ -0,0 +1,36 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.EditForumTopic
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.CustomEmojiId
import dev.inmo.tgbotapi.types.ForumTopic
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.editForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId,
name: String,
iconEmojiId: CustomEmojiId
) = execute(
EditForumTopic(
chatId,
messageThreadId,
name,
iconEmojiId
)
)
suspend fun TelegramBot.editForumTopic(
chat: Chat,
messageThreadId: MessageThreadId,
name: String,
iconEmojiId: CustomEmojiId
) = editForumTopic(chat.id, messageThreadId, name, iconEmojiId)
suspend fun TelegramBot.editForumTopic(
chatIdentifier: ChatIdentifier,
forumTopic: ForumTopic,
iconEmojiId: CustomEmojiId = forumTopic.iconEmojiId ?: error("Icon emoji id in forum topic should be presented when edit forum topic basing on other forum topic object")
) = editForumTopic(chatIdentifier, forumTopic.messageThreadId, forumTopic.name, iconEmojiId)

View File

@@ -0,0 +1,28 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.ReopenForumTopic
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ForumTopic
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.reopenForumTopic(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
) = execute(
ReopenForumTopic(
chatId,
messageThreadId
)
)
suspend fun TelegramBot.reopenForumTopic(
chat: Chat,
messageThreadId: MessageThreadId
) = reopenForumTopic(chat.id, messageThreadId)
suspend fun TelegramBot.reopenForumTopic(
chat: Chat,
forumTopic: ForumTopic
) = reopenForumTopic(chat.id, forumTopic.messageThreadId)

View File

@@ -0,0 +1,28 @@
package dev.inmo.tgbotapi.extensions.api.chat.forum
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.forum.UnpinAllForumTopicMessages
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ForumTopic
import dev.inmo.tgbotapi.types.MessageThreadId
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.unpinAllForumTopicMessages(
chatId: ChatIdentifier,
messageThreadId: MessageThreadId
) = execute(
UnpinAllForumTopicMessages(
chatId,
messageThreadId
)
)
suspend fun TelegramBot.unpinAllForumTopicMessages(
chat: Chat,
messageThreadId: MessageThreadId
) = unpinAllForumTopicMessages(chat.id, messageThreadId)
suspend fun TelegramBot.unpinAllForumTopicMessages(
chat: Chat,
forumTopic: ForumTopic
) = unpinAllForumTopicMessages(chat.id, forumTopic.messageThreadId)

View File

@@ -2,11 +2,28 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.get.GetChat
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.*
import dev.inmo.tgbotapi.types.chat.abstracts.*
import dev.inmo.tgbotapi.types.chat.abstracts.extended.*
import dev.inmo.tgbotapi.types.chat.extended.*
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.ChannelChat
import dev.inmo.tgbotapi.types.chat.ChannelChatImpl
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.chat.CommonUser
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChat
import dev.inmo.tgbotapi.types.chat.ExtendedChannelChatImpl
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChat
import dev.inmo.tgbotapi.types.chat.ExtendedGroupChatImpl
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChat
import dev.inmo.tgbotapi.types.chat.ExtendedPrivateChatImpl
import dev.inmo.tgbotapi.types.chat.ExtendedPublicChat
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChat
import dev.inmo.tgbotapi.types.chat.ExtendedSupergroupChatImpl
import dev.inmo.tgbotapi.types.chat.ExtendedUser
import dev.inmo.tgbotapi.types.chat.GroupChat
import dev.inmo.tgbotapi.types.chat.GroupChatImpl
import dev.inmo.tgbotapi.types.chat.PrivateChat
import dev.inmo.tgbotapi.types.chat.PrivateChatImpl
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.SupergroupChat
import dev.inmo.tgbotapi.types.chat.SupergroupChatImpl
import dev.inmo.tgbotapi.utils.PreviewFeature
suspend fun TelegramBot.getChat(
@@ -18,7 +35,7 @@ suspend fun TelegramBot.getChat(
) = getChat(chat.id)
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedPublicChat] with unsafe operator "as"
*
* @throws ClassCastException
@@ -30,7 +47,7 @@ suspend fun TelegramBot.getChat(
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedChannelChat] with unsafe operator "as"
*
* @throws ClassCastException
@@ -41,7 +58,7 @@ suspend fun TelegramBot.getChat(
) = getChat(chat.id) as ExtendedChannelChat
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedChannelChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
@@ -53,7 +70,7 @@ suspend fun TelegramBot.getChat(
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedGroupChat] with unsafe operator "as"
*
* @throws ClassCastException
@@ -64,7 +81,7 @@ suspend fun TelegramBot.getChat(
) = getChat(chat.id) as ExtendedGroupChat
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedGroupChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
@@ -76,7 +93,7 @@ suspend fun TelegramBot.getChat(
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedSupergroupChat] with unsafe operator "as"
*
* @throws ClassCastException
@@ -87,7 +104,7 @@ suspend fun TelegramBot.getChat(
) = getChat(chat.id) as ExtendedSupergroupChat
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedSupergroupChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
@@ -99,7 +116,7 @@ suspend fun TelegramBot.getChat(
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedPrivateChat] with unsafe operator "as"
*
* @throws ClassCastException
@@ -110,7 +127,7 @@ suspend fun TelegramBot.getChat(
) = getChat(chat.id) as ExtendedPrivateChat
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedPrivateChatImpl] with unsafe operator "as"
*
* @throws ClassCastException
@@ -121,7 +138,7 @@ suspend fun TelegramBot.getChat(
) = getChat(chat.id) as ExtendedPrivateChatImpl
/**
* Will cast incoming [dev.inmo.tgbotapi.types.chat.abstracts.extended.ExtendedChat] to a
* Will cast incoming [dev.inmo.tgbotapi.types.chat.ExtendedChat] to a
* [ExtendedUser] with unsafe operator "as"
*
* @throws ClassCastException

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.get.GetChatAdministrators
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.getChatAdministrators(
chatId: ChatIdentifier

View File

@@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.extensions.api.chat.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.get.GetChatMemberCount
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.getChatMemberCount(
chatId: ChatIdentifier
) = execute(GetChatMemberCount(chatId))
suspend fun TelegramBot.getChatMemberCount(
chat: PublicChat
) = getChatMemberCount(chat.id)

View File

@@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.extensions.api.chat.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.get.GetChatMenuButton
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.chat.PrivateChat
suspend fun TelegramBot.getChatMenuButton(
chatId: IdChatIdentifier
) = execute(GetChatMenuButton(chatId))
suspend fun TelegramBot.getChatMenuButton(
chat: PrivateChat
) = getChatMenuButton(chat.id)

View File

@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.extensions.api.chat.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.get.GetDefaultChatMenuButton
suspend fun TelegramBot.getDefaultChatMenuButton() = execute(GetDefaultChatMenuButton)

View File

@@ -0,0 +1,6 @@
package dev.inmo.tgbotapi.extensions.api.chat.get
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.get.GetForumTopicIconStickers
suspend fun TelegramBot.getForumTopicIconStickers() = execute(GetForumTopicIconStickers)

View File

@@ -0,0 +1,42 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.ApproveChatJoinRequest
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
suspend fun TelegramBot.approveChatJoinRequest(
chatId: ChatIdentifier,
userId: UserId
) = execute(ApproveChatJoinRequest(chatId, userId))
suspend fun TelegramBot.approveChatJoinRequest(
chat: PublicChat,
userId: UserId
) = approveChatJoinRequest(chat.id, userId)
suspend fun TelegramBot.approveChatJoinRequest(
chatId: ChatIdentifier,
user: User
) = approveChatJoinRequest(chatId, user.id)
suspend fun TelegramBot.approveChatJoinRequest(
chat: PublicChat,
user: User
) = approveChatJoinRequest(chat.id, user.id)
suspend fun TelegramBot.approveChatJoinRequest(
chatJoinRequest: ChatJoinRequest
) = approveChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
suspend fun TelegramBot.approve(
chatJoinRequest: ChatJoinRequest
) = approveChatJoinRequest(chatJoinRequest)
suspend fun TelegramBot.approveChatJoinRequest(
chatJoinRequestUpdate: ChatJoinRequestUpdate
) = approveChatJoinRequest(chatJoinRequestUpdate.data)

View File

@@ -0,0 +1,86 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import com.soywiz.klock.DateTime
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.CreateChatInviteLink
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MembersLimit
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.toTelegramDate
suspend fun TelegramBot.createChatInviteLinkUnlimited(
chatId: ChatIdentifier,
name: String? = null,
expiration: TelegramDate? = null
) = execute(CreateChatInviteLink.unlimited(chatId, name, expiration))
suspend fun TelegramBot.createChatInviteLinkUnlimited(
chat: PublicChat,
name: String? = null,
expiration: TelegramDate? = null,
) = createChatInviteLinkUnlimited(chat.id, name, expiration)
suspend fun TelegramBot.createChatInviteLinkUnlimited(
chatId: ChatIdentifier,
expiration: DateTime,
name: String? = null,
) = createChatInviteLinkUnlimited(chatId, name, expiration.toTelegramDate())
suspend fun TelegramBot.createChatInviteLinkUnlimited(
chat: PublicChat,
expiration: DateTime,
name: String? = null
) = createChatInviteLinkUnlimited(chat.id, name, expiration.toTelegramDate())
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
chatId: ChatIdentifier,
membersLimit: MembersLimit,
name: String? = null,
expiration: TelegramDate? = null
) = execute(CreateChatInviteLink.withLimitedMembers(chatId, membersLimit, name, expiration))
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
chat: PublicChat,
membersLimit: MembersLimit,
name: String? = null,
expiration: TelegramDate? = null,
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration)
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
chatId: ChatIdentifier,
membersLimit: MembersLimit,
expiration: DateTime,
name: String? = null,
) = createChatInviteLinkWithLimitedMembers(chatId, membersLimit, name, expiration.toTelegramDate())
suspend fun TelegramBot.createChatInviteLinkWithLimitedMembers(
chat: PublicChat,
membersLimit: MembersLimit,
expiration: DateTime,
name: String? = null,
) = createChatInviteLinkWithLimitedMembers(chat.id, membersLimit, name, expiration.toTelegramDate())
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
chatId: ChatIdentifier,
name: String? = null,
expiration: TelegramDate? = null
) = execute(CreateChatInviteLink.withJoinRequest(chatId, name, expiration))
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
chat: PublicChat,
name: String? = null,
expiration: TelegramDate? = null,
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration)
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
chatId: ChatIdentifier,
expiration: DateTime,
name: String? = null,
) = createChatInviteLinkWithJoinRequest(chatId, name, expiration.toTelegramDate())
suspend fun TelegramBot.createChatInviteLinkWithJoinRequest(
chat: PublicChat,
expiration: DateTime,
name: String? = null,
) = createChatInviteLinkWithJoinRequest(chat.id, name, expiration.toTelegramDate())

View File

@@ -0,0 +1,42 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.DeclineChatJoinRequest
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.ChatJoinRequest
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
import dev.inmo.tgbotapi.types.update.ChatJoinRequestUpdate
suspend fun TelegramBot.declineChatJoinRequest(
chatId: ChatIdentifier,
userId: UserId
) = execute(DeclineChatJoinRequest(chatId, userId))
suspend fun TelegramBot.declineChatJoinRequest(
chat: PublicChat,
userId: UserId
) = declineChatJoinRequest(chat.id, userId)
suspend fun TelegramBot.declineChatJoinRequest(
chatId: ChatIdentifier,
user: User
) = declineChatJoinRequest(chatId, user.id)
suspend fun TelegramBot.declineChatJoinRequest(
chat: PublicChat,
user: User
) = declineChatJoinRequest(chat.id, user.id)
suspend fun TelegramBot.declineChatJoinRequest(
chatJoinRequest: ChatJoinRequest
) = declineChatJoinRequest(chatJoinRequest.chat, chatJoinRequest.user)
suspend fun TelegramBot.decline(
chatJoinRequest: ChatJoinRequest
) = declineChatJoinRequest(chatJoinRequest)
suspend fun TelegramBot.declineChatJoinRequest(
chatJoinRequestUpdate: ChatJoinRequestUpdate
) = declineChatJoinRequest(chatJoinRequestUpdate.data)

View File

@@ -0,0 +1,187 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import com.soywiz.klock.DateTime
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.EditChatInviteLink
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ChatInviteLink
import dev.inmo.tgbotapi.types.MembersLimit
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.toTelegramDate
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chatId: ChatIdentifier,
previousLink: String,
name: String? = null,
expiration: TelegramDate? = null
) = execute(EditChatInviteLink.unlimited(chatId, previousLink, name, expiration))
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chat: PublicChat,
previousLink: String,
name: String? = null,
expiration: TelegramDate? = null,
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chatId: ChatIdentifier,
previousLink: String,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkUnlimited(chatId, previousLink, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chat: PublicChat,
previousLink: String,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chatId: ChatIdentifier,
previousLink: String,
membersLimit: MembersLimit,
name: String? = null,
expiration: TelegramDate? = null
) = execute(EditChatInviteLink.withLimitedMembers(chatId, previousLink, membersLimit, name, expiration))
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chat: PublicChat,
previousLink: String,
membersLimit: MembersLimit,
name: String? = null,
expiration: TelegramDate? = null,
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chatId: ChatIdentifier,
previousLink: String,
membersLimit: MembersLimit,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chat: PublicChat,
previousLink: String,
membersLimit: MembersLimit,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chatId: ChatIdentifier,
previousLink: String,
name: String? = null,
expiration: TelegramDate? = null
) = execute(EditChatInviteLink.withJoinRequest(chatId, previousLink, name, expiration))
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chat: PublicChat,
previousLink: String,
name: String? = null,
expiration: TelegramDate? = null,
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chatId: ChatIdentifier,
previousLink: String,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chat: PublicChat,
previousLink: String,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chatId: ChatIdentifier,
previousLink: ChatInviteLink,
name: String? = null,
expiration: TelegramDate? = null
) = editChatInviteLinkUnlimited(chatId, previousLink.inviteLink, name, expiration)
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chat: PublicChat,
previousLink: ChatInviteLink,
name: String? = null,
expiration: TelegramDate? = null,
) = editChatInviteLinkUnlimited(chat.id, previousLink, name, expiration)
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chatId: ChatIdentifier,
previousLink: ChatInviteLink,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkUnlimited(chatId, previousLink, name, expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkUnlimited(
chat: PublicChat,
previousLink: ChatInviteLink,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkUnlimited(chat.id, previousLink, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chatId: ChatIdentifier,
previousLink: ChatInviteLink,
membersLimit: MembersLimit,
name: String? = null,
expiration: TelegramDate? = null
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink.inviteLink, membersLimit, name, expiration)
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chat: PublicChat,
previousLink: ChatInviteLink,
membersLimit: MembersLimit,
name: String? = null,
expiration: TelegramDate? = null,
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name, expiration)
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chatId: ChatIdentifier,
previousLink: ChatInviteLink,
membersLimit: MembersLimit,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithLimitedMembers(chatId, previousLink, membersLimit, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithLimitedMembers(
chat: PublicChat,
previousLink: ChatInviteLink,
membersLimit: MembersLimit,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithLimitedMembers(chat.id, previousLink, membersLimit, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chatId: ChatIdentifier,
previousLink: ChatInviteLink,
name: String? = null,
expiration: TelegramDate? = null
) = editChatInviteLinkWithJoinRequest(chatId, previousLink.inviteLink, name, expiration)
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chat: PublicChat,
previousLink: ChatInviteLink,
name: String? = null,
expiration: TelegramDate? = null,
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name, expiration)
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chatId: ChatIdentifier,
previousLink: ChatInviteLink,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithJoinRequest(chatId, previousLink, name , expiration.toTelegramDate())
suspend fun TelegramBot.editChatInviteLinkWithJoinRequest(
chat: PublicChat,
previousLink: ChatInviteLink,
expiration: DateTime,
name: String? = null,
) = editChatInviteLinkWithJoinRequest(chat.id, previousLink, name , expiration.toTelegramDate())

View File

@@ -0,0 +1,27 @@
package dev.inmo.tgbotapi.extensions.api.chat.invite_links
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.invite_links.RevokeChatInviteLink
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.ChatInviteLink
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.revokeChatInviteLink(
chatId: ChatIdentifier,
previousLink: String
) = execute(RevokeChatInviteLink(chatId, previousLink))
suspend fun TelegramBot.revokeChatInviteLink(
chat: PublicChat,
previousLink: String
) = revokeChatInviteLink(chat.id, previousLink)
suspend fun TelegramBot.revokeChatInviteLink(
chatId: ChatIdentifier,
previousLink: ChatInviteLink
) = revokeChatInviteLink(chatId, previousLink.inviteLink)
suspend fun TelegramBot.revokeChatInviteLink(
chat: PublicChat,
previousLink: ChatInviteLink
) = revokeChatInviteLink(chat, previousLink.inviteLink)

View File

@@ -0,0 +1,38 @@
package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.BanChatMember
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
suspend fun TelegramBot.banChatMember(
chatId: ChatIdentifier,
userId: UserId,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = execute(BanChatMember(chatId, userId, untilDate, revokeMessages))
suspend fun TelegramBot.banChatMember(
chat: PublicChat,
userId: UserId,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = banChatMember(chat.id, userId, untilDate, revokeMessages)
suspend fun TelegramBot.banChatMember(
chatId: IdChatIdentifier,
user: User,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = banChatMember(chatId, user.id, untilDate, revokeMessages)
suspend fun TelegramBot.banChatMember(
chat: PublicChat,
user: User,
untilDate: TelegramDate? = null,
revokeMessages: Boolean? = null
) = banChatMember(chat.id, user.id, untilDate, revokeMessages)

View File

@@ -0,0 +1,27 @@
package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.BanChatSenderChat
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.banChatSenderChat(
chatId: ChatIdentifier,
senderChatId: IdChatIdentifier
) = execute(BanChatSenderChat(chatId, senderChatId))
suspend fun TelegramBot.banChatSenderChat(
chat: PublicChat,
senderChatId: IdChatIdentifier
) = banChatSenderChat(chat.id, senderChatId)
suspend fun TelegramBot.banChatSenderChat(
chatId: IdChatIdentifier,
senderChat: PublicChat
) = banChatSenderChat(chatId, senderChat.id)
suspend fun TelegramBot.banChatSenderChat(
chat: PublicChat,
senderChat: PublicChat,
) = banChatSenderChat(chat.id, senderChat)

View File

@@ -2,8 +2,11 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.GetChatMember
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
suspend fun TelegramBot.getChatMember(
chatId: ChatIdentifier,
@@ -16,7 +19,7 @@ suspend fun TelegramBot.getChatMember(
) = getChatMember(chat.id, userId)
suspend fun TelegramBot.getChatMember(
chatId: ChatId,
chatId: IdChatIdentifier,
user: User
) = getChatMember(chatId, user.id)

View File

@@ -2,13 +2,18 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.PromoteChatMember
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
suspend fun TelegramBot.promoteChatMember(
chatId: ChatIdentifier,
userId: UserId,
untilDate: TelegramDate? = null,
isAnonymous: Boolean? = null,
canChangeInfo: Boolean? = null,
canPostMessages: Boolean? = null,
canEditMessages: Boolean? = null,
@@ -16,12 +21,16 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers: Boolean? = null,
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = execute(
PromoteChatMember(
chatId,
userId,
untilDate,
isAnonymous,
canChangeInfo,
canPostMessages,
canEditMessages,
@@ -29,7 +38,10 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers,
canRestrictMembers,
canPinMessages,
canPromoteMembers
canPromoteMembers,
canManageVideoChats,
canManageChat,
canManageTopics
)
)
@@ -37,6 +49,7 @@ suspend fun TelegramBot.promoteChatMember(
chat: PublicChat,
userId: UserId,
untilDate: TelegramDate? = null,
isAnonymous: Boolean? = null,
canChangeInfo: Boolean? = null,
canPostMessages: Boolean? = null,
canEditMessages: Boolean? = null,
@@ -44,11 +57,15 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers: Boolean? = null,
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = promoteChatMember(
chat.id,
userId,
untilDate,
isAnonymous,
canChangeInfo,
canPostMessages,
canEditMessages,
@@ -56,13 +73,17 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers,
canRestrictMembers,
canPinMessages,
canPromoteMembers
canPromoteMembers,
canManageVideoChats,
canManageChat,
canManageTopics
)
suspend fun TelegramBot.promoteChatMember(
chatId: ChatId,
chatId: IdChatIdentifier,
user: User,
untilDate: TelegramDate? = null,
isAnonymous: Boolean? = null,
canChangeInfo: Boolean? = null,
canPostMessages: Boolean? = null,
canEditMessages: Boolean? = null,
@@ -70,11 +91,15 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers: Boolean? = null,
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = promoteChatMember(
chatId,
user.id,
untilDate,
isAnonymous,
canChangeInfo,
canPostMessages,
canEditMessages,
@@ -82,13 +107,17 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers,
canRestrictMembers,
canPinMessages,
canPromoteMembers
canPromoteMembers,
canManageVideoChats,
canManageChat,
canManageTopics
)
suspend fun TelegramBot.promoteChatMember(
chat: PublicChat,
user: User,
untilDate: TelegramDate? = null,
isAnonymous: Boolean? = null,
canChangeInfo: Boolean? = null,
canPostMessages: Boolean? = null,
canEditMessages: Boolean? = null,
@@ -96,11 +125,15 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers: Boolean? = null,
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null
canPromoteMembers: Boolean? = null,
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = promoteChatMember(
chat.id,
user.id,
untilDate,
isAnonymous,
canChangeInfo,
canPostMessages,
canEditMessages,
@@ -108,5 +141,8 @@ suspend fun TelegramBot.promoteChatMember(
canInviteUsers,
canRestrictMembers,
canPinMessages,
canPromoteMembers
canPromoteMembers,
canManageVideoChats,
canManageChat,
canManageTopics
)

View File

@@ -2,9 +2,13 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.RestrictChatMember
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.TelegramDate
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.ChatPermissions
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
suspend fun TelegramBot.restrictChatMember(
chatId: ChatIdentifier,
@@ -21,7 +25,7 @@ suspend fun TelegramBot.restrictChatMember(
) = restrictChatMember(chat.id, userId, untilDate, permissions)
suspend fun TelegramBot.restrictChatMember(
chatId: ChatId,
chatId: IdChatIdentifier,
user: User,
untilDate: TelegramDate? = null,
permissions: ChatPermissions = ChatPermissions()

View File

@@ -2,11 +2,13 @@ package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.SetChatAdministratorCustomTitle
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
suspend fun TelegramBot.setChatAdministratorCustomTitle(
chatId: ChatId,
chatId: IdChatIdentifier,
userId: UserId,
customTitle: String
) = execute(SetChatAdministratorCustomTitle(chatId, userId, customTitle))
@@ -18,7 +20,7 @@ suspend fun TelegramBot.setChatAdministratorCustomTitle(
) = setChatAdministratorCustomTitle(chat.id, userId, customTitle)
suspend fun TelegramBot.setChatAdministratorCustomTitle(
chatId: ChatId,
chatId: IdChatIdentifier,
user: User,
customTitle: String
) = setChatAdministratorCustomTitle(chatId, user.id, customTitle)
@@ -27,4 +29,4 @@ suspend fun TelegramBot.setChatAdministratorCustomTitle(
chat: PublicChat,
user: User,
customTitle: String
) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)
) = setChatAdministratorCustomTitle(chat.id, user.id, customTitle)

View File

@@ -0,0 +1,34 @@
package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatMember
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.UserId
import dev.inmo.tgbotapi.types.chat.PublicChat
import dev.inmo.tgbotapi.types.chat.User
suspend fun TelegramBot.unbanChatMember(
chatId: ChatIdentifier,
userId: UserId,
onlyIfBanned: Boolean? = null
) = execute(UnbanChatMember(chatId, userId, onlyIfBanned))
suspend fun TelegramBot.unbanChatMember(
chat: PublicChat,
userId: UserId,
onlyIfBanned: Boolean? = null
) = unbanChatMember(chat.id, userId, onlyIfBanned)
suspend fun TelegramBot.unbanChatMember(
chatId: IdChatIdentifier,
user: User,
onlyIfBanned: Boolean? = null
) = unbanChatMember(chatId, user.id, onlyIfBanned)
suspend fun TelegramBot.unbanChatMember(
chat: PublicChat,
user: User,
onlyIfBanned: Boolean? = null
) = unbanChatMember(chat.id, user.id, onlyIfBanned)

View File

@@ -0,0 +1,27 @@
package dev.inmo.tgbotapi.extensions.api.chat.members
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.members.UnbanChatSenderChat
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.unbanChatSenderChat(
chatId: ChatIdentifier,
senderChatId: IdChatIdentifier
) = execute(UnbanChatSenderChat(chatId, senderChatId))
suspend fun TelegramBot.unbanChatSenderChat(
chat: PublicChat,
senderChatId: IdChatIdentifier
) = unbanChatSenderChat(chat.id, senderChatId)
suspend fun TelegramBot.unbanChatSenderChat(
chatId: IdChatIdentifier,
senderChat: PublicChat
) = unbanChatSenderChat(chatId, senderChat.id)
suspend fun TelegramBot.unbanChatSenderChat(
chat: PublicChat,
senderChat: PublicChat,
) = unbanChatSenderChat(chat.id, senderChat)

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.DeleteChatPhoto
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.deleteChatPhoto(
chatId: ChatIdentifier

View File

@@ -3,27 +3,23 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.PinChatMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
suspend fun TelegramBot.pinChatMessage(
chatId: ChatIdentifier,
messageId: MessageIdentifier,
messageId: MessageId,
disableNotification: Boolean = false
) = execute(PinChatMessage(chatId, messageId, disableNotification))
suspend fun TelegramBot.pinChatMessage(
chat: PublicChat,
messageId: MessageIdentifier,
chat: Chat,
messageId: MessageId,
disableNotification: Boolean = false
) = pinChatMessage(chat.id, messageId, disableNotification)
suspend fun TelegramBot.pinChatMessage(
message: Message,
disableNotification: Boolean = false
) = if (message.chat is PublicChat) {
pinChatMessage(message.chat.id, message.messageId, disableNotification)
} else {
error("It is possible to pin messages only in non one-to-one chats")
}
) = pinChatMessage(message.chat.id, message.messageId, disableNotification)

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.SetChatDescription
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.setChatDescription(
chatId: ChatIdentifier,

View File

@@ -0,0 +1,17 @@
package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.SetChatMenuButton
import dev.inmo.tgbotapi.types.IdChatIdentifier
import dev.inmo.tgbotapi.types.MenuButton
import dev.inmo.tgbotapi.types.chat.PrivateChat
suspend fun TelegramBot.setChatMenuButton(
chatId: IdChatIdentifier,
menuButton: MenuButton
) = execute(SetChatMenuButton(chatId, menuButton))
suspend fun TelegramBot.setChatMenuButton(
chat: PrivateChat,
menuButton: MenuButton
) = setChatMenuButton(chat.id, menuButton)

View File

@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.SetChatPermissions
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.ChatPermissions
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.setDefaultChatMembersPermissions(
chatId: ChatIdentifier,

View File

@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.abstracts.MultipartFile
import dev.inmo.tgbotapi.requests.chat.modify.SetChatPhoto
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.setChatPhoto(
chatId: ChatIdentifier,

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.SetChatTitle
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.setChatTitle(
chatId: ChatIdentifier,

View File

@@ -0,0 +1,9 @@
package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.SetDefaultChatMenuButton
import dev.inmo.tgbotapi.types.MenuButton
suspend fun TelegramBot.setDefaultChatMenuButton(
menuButton: MenuButton
) = execute(SetDefaultChatMenuButton(menuButton))

View File

@@ -0,0 +1,14 @@
package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.UnpinAllChatMessages
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.unpinAllChatMessages(
chatId: ChatIdentifier
) = execute(UnpinAllChatMessages(chatId))
suspend fun TelegramBot.unpinAllChatMessages(
chat: Chat
) = unpinAllChatMessages(chat.id)

View File

@@ -0,0 +1,22 @@
package dev.inmo.tgbotapi.extensions.api.chat.modify
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.modify.UnpinChatMessage
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.Message
suspend fun TelegramBot.unpinChatMessage(
chatId: ChatIdentifier,
messageId: MessageId? = null
) = execute(UnpinChatMessage(chatId, messageId))
suspend fun TelegramBot.unpinChatMessage(
chat: Chat,
messageId: MessageId? = null
) = unpinChatMessage(chat.id, messageId)
suspend fun TelegramBot.unpinChatMessage(
message: Message
) = unpinChatMessage(message.chat.id, message.messageId)

View File

@@ -3,7 +3,7 @@ package dev.inmo.tgbotapi.extensions.api.chat.stickers
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.stickers.DeleteChatStickerSet
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat
import dev.inmo.tgbotapi.types.chat.SupergroupChat
suspend fun TelegramBot.deleteChatStickerSet(
chatId: ChatIdentifier

View File

@@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.chat.stickers.SetChatStickerSet
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.StickerSetName
import dev.inmo.tgbotapi.types.chat.abstracts.SupergroupChat
import dev.inmo.tgbotapi.types.chat.SupergroupChat
suspend fun TelegramBot.setChatStickerSet(
chatId: ChatIdentifier,

View File

@@ -0,0 +1,308 @@
package dev.inmo.tgbotapi.extensions.api.edit
import dev.inmo.tgbotapi.abstracts.TextedWithTextSources
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.extensions.api.edit.caption.editMessageCaption
import dev.inmo.tgbotapi.extensions.api.edit.location.live.editLiveLocation
import dev.inmo.tgbotapi.extensions.api.edit.media.editMessageMedia
import dev.inmo.tgbotapi.extensions.api.edit.reply_markup.editMessageReplyMarkup
import dev.inmo.tgbotapi.extensions.api.edit.text.editMessageText
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.media.TelegramMedia
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.content.*
import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.utils.EntitiesBuilderBody
import dev.inmo.tgbotapi.utils.buildEntities
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun <T> TelegramBot.edit(
message: ContentMessage<T>,
text: String,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
return editMessageCaption(message, text, parseMode, replyMarkup)
}
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun <T> TelegramBot.edit(
message: ContentMessage<T>,
entities: List<TextSource>,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
return editMessageCaption(message, entities, replyMarkup)
}
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chat: Chat,
messageId: MessageId,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<LocationContent>,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(
chatId, messageId, location, replyMarkup
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chat: Chat,
messageId: MessageId,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat, messageId, location, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<LocationContent>,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message, location, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
media: TelegramMedia,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(chatId, messageId, media, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chat: Chat,
messageId: MessageId,
media: TelegramMedia,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(chat, messageId, media, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<MediaContent>,
media: TelegramMedia,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageMedia(message, media, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(chatId, messageId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chat: Chat,
messageId: MessageId,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(chat, messageId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: Message,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageReplyMarkup(message, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
text: String,
parseMode: ParseMode? = null,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(chatId, messageId, text, parseMode, disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
entities: TextSourcesList,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageText(chatId, messageId, entities, disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
separator: TextSource? = null,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
chatId: ChatIdentifier,
messageId: MessageId,
separator: String,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
) = edit(chatId, messageId, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>,
text: String,
parseMode: ParseMode? = null,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = edit(message.chat.id, message.messageId, text, parseMode, disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>,
entities: TextSourcesList,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = edit(message.chat.id, message.messageId, entities, disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>,
separator: TextSource? = null,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.edit(
message: ContentMessage<TextContent>,
separator: String,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>,
separator: TextSource? = null,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageText(
message: ContentMessage<TextContent>,
separator: String,
disableWebPagePreview: Boolean? = null,
replyMarkup: InlineKeyboardMarkup? = null,
builderBody: EntitiesBuilderBody
) = edit(message, buildEntities(separator, builderBody), disableWebPagePreview, replyMarkup)

View File

@@ -0,0 +1,106 @@
package dev.inmo.tgbotapi.extensions.api.edit.caption
import dev.inmo.tgbotapi.abstracts.TextedWithTextSources
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.caption.EditChatMessageCaption
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.message.textsources.TextSource
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.abstracts.Message
import dev.inmo.tgbotapi.types.message.content.MediaContent
import dev.inmo.tgbotapi.utils.RiskFeature
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageCaption(
chatId: ChatIdentifier,
messageId: MessageId,
text: String,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageCaption(chatId, messageId, text, parseMode, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageCaption(
chat: Chat,
messageId: MessageId,
text: String,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageCaption(chat.id, messageId, text, parseMode, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun <T> TelegramBot.editMessageCaption(
message: ContentMessage<T>,
text: String,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
@Suppress("UNCHECKED_CAST")
return editMessageCaption(message.chat.id, message.messageId, text, parseMode, replyMarkup) as ContentMessage<T>
}
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageCaption(
chatId: ChatIdentifier,
messageId: MessageId,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageCaption(chatId, messageId, entities, replyMarkup)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageCaption(
chat: Chat,
messageId: MessageId,
entities: List<TextSource>,
replyMarkup: InlineKeyboardMarkup? = null
) = editMessageCaption(chat.id, messageId, entities, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun <T> TelegramBot.editMessageCaption(
message: ContentMessage<T>,
entities: List<TextSource>,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<T> where T : TextedWithTextSources, T : MediaContent {
@Suppress("UNCHECKED_CAST")
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup) as ContentMessage<T>
}
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
@RiskFeature("This method is unsafe due to absence of any guaranties about the type of message. In case if message is not media message this method will throw an exception")
suspend fun <T> TelegramBot.editMessageCaption(
message: Message,
entities: List<TextSource>,
replyMarkup: InlineKeyboardMarkup? = null
): ContentMessage<MediaContent> where T : TextedWithTextSources, T : MediaContent {
return editMessageCaption(message.chat.id, message.messageId, entities, replyMarkup)
}

View File

@@ -0,0 +1,29 @@
package dev.inmo.tgbotapi.extensions.api.edit.caption
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.caption.EditInlineMessageCaption
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
import dev.inmo.tgbotapi.types.message.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.message.ParseMode
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageCaption(
inlineMessageId: InlineMessageIdentifier,
text: String,
parseMode: ParseMode? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(EditInlineMessageCaption(inlineMessageId, text, parseMode, replyMarkup))
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editMessageCaption(
inlineMessageId: InlineMessageIdentifier,
entities: TextSourcesList,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(EditInlineMessageCaption(inlineMessageId, entities, replyMarkup))

View File

@@ -0,0 +1,94 @@
package dev.inmo.tgbotapi.extensions.api.edit.location.live
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.location.live.EditChatMessageLiveLocation
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.location.LiveLocation
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
chatId: ChatIdentifier,
messageId: MessageId,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageLiveLocation(
chatId, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
chat: Chat,
messageId: MessageId,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat.id, messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
message: ContentMessage<LocationContent>,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message.chat, message.messageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
chatId: ChatIdentifier,
messageId: MessageId,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditChatMessageLiveLocation(
chatId, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup
)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
chat: Chat,
messageId: MessageId,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(chat.id, messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.editLiveLocation(
message: ContentMessage<LocationContent>,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(message.chat, message.messageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)

View File

@@ -0,0 +1,26 @@
package dev.inmo.tgbotapi.extensions.api.edit.location.live
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.location.live.EditInlineMessageLiveLocation
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.location.LiveLocation
suspend fun TelegramBot.editLiveLocation(
inlineMessageId: InlineMessageIdentifier,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
heading: Degrees? = null,
proximityAlertRadius: Meters? = null,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
EditInlineMessageLiveLocation(
inlineMessageId, latitude, longitude, horizontalAccuracy, heading, proximityAlertRadius, replyMarkup
)
)
suspend fun TelegramBot.editLiveLocation(
inlineMessageId: InlineMessageIdentifier,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = editLiveLocation(inlineMessageId, location.latitude, location.longitude, location.horizontalAccuracy, location.heading, location.proximityAlertRadius, replyMarkup)

View File

@@ -1,17 +1,21 @@
package dev.inmo.tgbotapi.extensions.api.edit.LiveLocation
package dev.inmo.tgbotapi.extensions.api.edit.location.live
import dev.inmo.tgbotapi.bot.TelegramBot
import dev.inmo.tgbotapi.requests.edit.LiveLocation.StopChatMessageLiveLocation
import dev.inmo.tgbotapi.requests.edit.location.live.StopChatMessageLiveLocation
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.MessageIdentifier
import dev.inmo.tgbotapi.types.MessageId
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardMarkup
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.chat.Chat
import dev.inmo.tgbotapi.types.message.abstracts.ContentMessage
import dev.inmo.tgbotapi.types.message.content.LocationContent
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopLiveLocation(
chatId: ChatIdentifier,
messageId: MessageIdentifier,
messageId: MessageId,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
StopChatMessageLiveLocation(
@@ -19,12 +23,20 @@ suspend fun TelegramBot.stopLiveLocation(
)
)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopLiveLocation(
chat: Chat,
messageId: MessageIdentifier,
messageId: MessageId,
replyMarkup: InlineKeyboardMarkup? = null
) = stopLiveLocation(chat.id, messageId, replyMarkup)
/**
* @param replyMarkup Some [InlineKeyboardMarkup]. See [dev.inmo.tgbotapi.extensions.utils.types.buttons.inlineKeyboard]
* as a builder for that
*/
suspend fun TelegramBot.stopLiveLocation(
message: ContentMessage<LocationContent>,
replyMarkup: InlineKeyboardMarkup? = null

Some files were not shown because too many files have changed in this diff Show More