Compare commits

..
Author SHA1 Message Date
InsanusMokrassar 113621f619 Merge branch '4.0.0' into task/676-rework_of_media_groups 2022-11-08 13:07:55 +06:00
InsanusMokrassar 6a899f1217 add threadIdOrNull extension 2022-11-08 13:07:16 +06:00
InsanusMokrassar 6bc96162a8 add waiters and small improvement of triggers 2022-11-08 12:17:56 +06:00
InsanusMokrassar 4736610aa8 several fixes 2022-11-08 02:50:22 +06:00
InsanusMokrassar f6f07a5e8a fixes 2022-11-08 02:27:38 +06:00
InsanusMokrassar b32ce88a97 fixes 2022-11-08 01:51:27 +06:00
InsanusMokrassar 47f514a635 Merge branch '4.0.0' into task/676-rework_of_media_groups 2022-11-08 00:36:46 +06:00
InsanusMokrassar a80ed2ec57 fixes in replies 2022-11-08 00:21:16 +06:00
InsanusMokrassar b1bba43f29 update api according to new topics api 2022-11-08 00:11:14 +06:00
InsanusMokrassar 9df258805d add support of threads in send requests of core module 2022-11-07 23:02:58 +06:00
InsanusMokrassar 8654437293 add TelegramBot#getForumTopicIconStickers 2022-11-06 16:01:05 +06:00
InsanusMokrassar bdbca92fe5 add api extensions for topics requests 2022-11-06 15:55:15 +06:00
InsanusMokrassar aca4d90608 add support of forum requests 2022-11-06 15:29:48 +06:00
InsanusMokrassar ad75aef64f add support of forum topic service messages 2022-11-06 14:56:01 +06:00
InsanusMokrassar 5bf30bc6c6 fix 2022-11-06 14:28:16 +06:00
InsanusMokrassar acd3298d4d active_usernames support 2022-11-06 14:26:51 +06:00
InsanusMokrassar 3f6f04d00f add support of emoji_status_custom_emoji_id 2022-11-06 14:21:28 +06:00
InsanusMokrassar c7f372c1e3 can_manage_topics support 2022-11-06 14:18:34 +06:00
InsanusMokrassar 1ed620df85 add support of message thread id in media group messages 2022-11-06 14:10:09 +06:00
InsanusMokrassar 541e00fa03 start rework 2022-11-06 14:07:31 +06:00
InsanusMokrassar 867a46d397 add support of forum chats 2022-11-06 12:51:53 +06:00
InsanusMokrassar 8f4eb74e39 Update CHANGELOG.md 2022-11-05 20:07:23 +06:00
InsanusMokrassar 16cc49e412 start 4.0.0 2022-11-05 20:05:18 +06:00
InsanusMokrassar 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
InsanusMokrassar c8413e1d18 Merge pull request #671 from InsanusMokrassar/3.3.1
3.3.1
2022-11-01 12:43:18 +06:00
InsanusMokrassar 8b15296ee7 Update CHANGELOG.md 2022-11-01 12:41:35 +06:00
InsanusMokrassar 0fcc717269 Update libs.versions.toml 2022-11-01 12:41:24 +06:00
InsanusMokrassar 2ce26b4f1e Update CHANGELOG.md 2022-10-31 02:28:23 +06:00
InsanusMokrassar b5d499b623 Update libs.versions.toml 2022-10-31 02:27:23 +06:00
InsanusMokrassar 102515dc8a Update CHANGELOG.md 2022-10-31 02:25:16 +06:00
InsanusMokrassar 777a58ce9a a little bit refactor hasCommands 2022-10-30 20:10:12 +06:00
InsanusMokrassar 7471da4ff0 update version of library 2022-10-30 19:48:04 +06:00
InsanusMokrassar e753db0e71 Merge pull request #662 from InsanusMokrassar/renovate/korlibs
Update korlibs to v3.3.0
2022-10-28 18:54:53 +06:00
InsanusMokrassar 70984424e3 Merge pull request #669 from madhead/feature/initial-filters
Add `hasCommands` / `hasNoCommands` extensions on `CommonMessage`
2022-10-28 18:54:16 +06:00
InsanusMokrassar c8354a330e Merge pull request #670 from InsanusMokrassar/renovate/ktor
Update ktor to v2.1.3
2022-10-28 18:53:38 +06:00
InsanusMokrassar 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
InsanusMokrassar d9846f27c9 Merge pull request #665 from InsanusMokrassar/3.3.0
3.3.0
2022-10-22 18:00:02 +06:00
InsanusMokrassar c10da2a10a Update CHANGELOG.md 2022-10-22 17:59:54 +06:00
InsanusMokrassar 8ed216619d deprecate TelegramBot#getStickerSet 2022-10-22 17:41:55 +06:00
InsanusMokrassar 62a9c687d5 update dependencies and changelog 2022-10-22 14:33:43 +06:00
InsanusMokrassar 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
InsanusMokrassar 54fb58de81 Update CHANGELOG.md 2022-10-19 19:25:01 +06:00
InsanusMokrassar 94ed4fed10 Update libs.versions.toml 2022-10-19 19:19:14 +06:00
InsanusMokrassar 63ceec70ca Merge pull request #664 from d1snin/bot-command
added `EntitiesBuilder.botCommand` and `EntitiesBuilder.botCommandln`…
2022-10-13 23:32:58 +06:00
root 636382fc8f Update EntitiesBuilder.kt 2022-10-13 23:31:41 +06:00
root ac7bf60182 Update BotCommandTextSource.kt 2022-10-13 23:30:34 +06:00
root 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
InsanusMokrassar 6fcd248aff update microutils 2022-10-13 18:25:44 +06:00
InsanusMokrassar 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
InsanusMokrassar 4f75bc792d Merge pull request #659 from InsanusMokrassar/3.2.7
3.2.7
2022-10-01 23:36:51 +06:00
InsanusMokrassar fda53cf171 update dependencies 2022-10-01 22:09:01 +06:00
InsanusMokrassar b588622c3d deprecate old row methods for keyboard builders 2022-09-28 20:48:55 +06:00
InsanusMokrassar 8b64a0c94e keyboard builders become typealiases 2022-09-28 20:38:16 +06:00
InsanusMokrassar 959f0dffba start 3.2.7 2022-09-28 20:02:45 +06:00
InsanusMokrassar 8fc9185884 Merge pull request #656 from InsanusMokrassar/3.2.6
3.2.6
2022-09-19 14:59:34 +06:00
InsanusMokrassar 3a9cf03958 add edit extensions with builders of text sources 2022-09-19 14:34:19 +06:00
InsanusMokrassar 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
InsanusMokrassar c460b4eacc small refactoring inside of entities builder 2022-09-19 12:57:22 +06:00
InsanusMokrassar 0aa58bd9f6 improve deprecation messages in old entities builder 2022-09-19 12:10:17 +06:00
InsanusMokrassar a4a82f69c6 replace entities builder 2022-09-19 11:18:01 +06:00
InsanusMokrassar d450ed9126 Fixes in ChatMemberSerializer#serialize method 2022-09-19 02:17:40 +06:00
InsanusMokrassar 69c5f1ae7d start 3.2.6 2022-09-19 02:16:12 +06:00
InsanusMokrassar e4e8eadfb5 Merge pull request #655 from InsanusMokrassar/3.2.5
3.2.5
2022-09-19 01:51:49 +06:00
InsanusMokrassar c1374c118d Improve support of new exceptions recovering mechanism 2022-09-19 01:39:23 +06:00
InsanusMokrassar 6004b159ec 3.2.5 2022-09-19 00:17:30 +06:00
InsanusMokrassar 67f95682d5 Merge pull request #654 from InsanusMokrassar/3.2.4
3.2.4
2022-09-16 21:29:21 +06:00
InsanusMokrassar 5aa5460a43 new edits 2022-09-16 16:36:21 +06:00
InsanusMokrassar e937845fc7 start 3.2.4 2022-09-16 15:43:40 +06:00
InsanusMokrassar 96f40e55bc Merge pull request #653 from InsanusMokrassar/3.2.3
3.2.3
2022-09-15 15:28:54 +06:00
InsanusMokrassar d3d8603c35 upfix 2022-09-15 15:22:08 +06:00
InsanusMokrassar 759650892c fix in DeleteMyCommands 2022-09-15 15:06:19 +06:00
InsanusMokrassar b58550a9ec start 3.2.3 2022-09-15 15:05:38 +06:00
InsanusMokrassar e15817e7c5 Merge pull request #652 from InsanusMokrassar/3.2.2
3.2.2
2022-09-15 13:11:29 +06:00
InsanusMokrassar 4cd1316e27 fix build 2022-09-15 12:46:17 +06:00
InsanusMokrassar 3575a62f34 MessageIdentifier -> MessageId, replies with chatsIds/messageIds 2022-09-15 00:17:18 +06:00
InsanusMokrassar 82f7d5bd4f start 3.2.2 2022-09-15 00:02:22 +06:00
InsanusMokrassar 7a5e6a69a1 Update README.md 2022-09-14 10:58:03 +06:00
InsanusMokrassar fd25db5633 Merge pull request #651 from InsanusMokrassar/3.2.1
3.2.1
2022-09-08 14:45:27 +06:00
InsanusMokrassar f539a24740 Update CHANGELOG.md 2022-09-08 14:36:10 +06:00
InsanusMokrassar 1d7b4ea862 Update libs.versions.toml 2022-09-08 14:35:17 +06:00
InsanusMokrassar 2d6f296c20 update dependencies 2022-09-07 16:33:29 +06:00
InsanusMokrassar 0ba1aa1127 start 3.2.1 2022-09-07 16:32:37 +06:00
InsanusMokrassar ae8a461e9d Merge pull request #648 from InsanusMokrassar/3.2.0
3.2.0
2022-08-26 16:36:27 +06:00
InsanusMokrassar 99f16e33a6 Update CHANGELOG.md 2022-08-26 12:44:11 +06:00
InsanusMokrassar e029b29f7f fixes 2022-08-26 12:20:20 +06:00
InsanusMokrassar c04f795fdd migrate onto 3.2.0 from 3.1.2 2022-08-26 11:00:36 +06:00
InsanusMokrassar b873898100 wrap client request exception into exception handling 2022-08-25 13:35:15 +06:00
InsanusMokrassar 61ac9df5e3 BotException 2022-08-25 13:32:12 +06:00
InsanusMokrassar b1931900e7 Update BotCommandTextSource.kt 2022-08-25 02:11:04 +06:00
InsanusMokrassar fab3af48d6 Update WaitCommandsMessages.kt 2022-08-25 02:04:19 +06:00
InsanusMokrassar 8d7563b6e4 Update WaitCommandsMessages.kt 2022-08-25 02:02:45 +06:00
InsanusMokrassar 05112afe0c add deeplinks triggers 2022-08-24 15:32:34 +06:00
InsanusMokrassar 9ea06de27c add waitCommands* expectations 2022-08-24 15:03:54 +06:00
InsanusMokrassar fff05a40d9 revert adding of mention waiters 2022-08-24 13:29:57 +06:00
InsanusMokrassar 5c6428f220 update microutils 2022-08-23 13:13:06 +06:00
InsanusMokrassar 766b7ca205 add waiters for mentions 2022-08-23 13:12:22 +06:00
InsanusMokrassar 41e6c52369 allowedUpdates is ALL_UPDATES_LIST by default everywhere 2022-08-23 11:55:28 +06:00
InsanusMokrassar 06013f624f update dependencies 2022-08-23 11:48:55 +06:00
InsanusMokrassar d8bba89f3f start 3.1.2 2022-08-23 11:47:31 +06:00
InsanusMokrassar 141281f96d Merge pull request #643 from InsanusMokrassar/3.1.1
3.1.1
2022-08-15 01:31:59 +06:00
InsanusMokrassar be7aaa7845 fixes and improvements in webapps 2022-08-15 01:29:24 +06:00
InsanusMokrassar 78c224ffa8 fix on asUser fun 2022-08-15 01:21:10 +06:00
InsanusMokrassar a08d07f7b3 fixes in popup params and buttons 2022-08-15 01:20:29 +06:00
InsanusMokrassar 69dde19543 Update CHANGELOG.md 2022-08-14 22:13:03 +06:00
InsanusMokrassar e8a3b93831 Update Extended.kt 2022-08-14 22:11:55 +06:00
InsanusMokrassar e10caa3171 add support of has_restricted_voice_and_video_messages 2022-08-14 21:56:25 +06:00
InsanusMokrassar d4fe4e09fc add support of Bot API 6.2 in webapp parts 2022-08-14 21:52:26 +06:00
InsanusMokrassar ad453afba2 start 3.1.1 2022-08-14 18:55:08 +06:00
InsanusMokrassar a0daca28b1 Merge pull request #642 from InsanusMokrassar/3.1.0
3.1.0
2022-08-13 14:44:00 +06:00
InsanusMokrassar cd62a9ef3c fixes 2022-08-13 14:40:00 +06:00
InsanusMokrassar 3c084d70e5 fix of #588 2022-08-13 13:13:07 +06:00
InsanusMokrassar 2611d4ecc1 fill changelog with dependnecies updates 2022-08-13 13:06:18 +06:00
InsanusMokrassar b4d853dfa0 update bot api support info 2022-08-13 13:03:34 +06:00
InsanusMokrassar 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
InsanusMokrassar 5f2660b804 fill raw sticker data 2022-08-13 12:20:28 +06:00
InsanusMokrassar c72dccc0f9 rework of stickers and stickersets 2022-08-13 11:58:42 +06:00
InsanusMokrassar 3fc1058491 start rework of stickers and stickersets 2022-08-13 00:02:48 +06:00
InsanusMokrassar c3668e978b add support of custom emojis 2022-08-12 23:21:53 +06:00
InsanusMokrassar 5a4a6d5710 start 3.1.0 2022-08-12 22:42:47 +06:00
InsanusMokrassar ed1d8beb2e Update libs.versions.toml 2022-08-12 13:28:45 +06:00
InsanusMokrassar 881ede7d2a start 3.0.3 2022-08-12 13:25:58 +06:00
InsanusMokrassar 60d3d279e7 Update gradle-wrapper.properties 2022-08-06 10:19:22 +06:00
InsanusMokrassar 4b84518dbb Merge pull request #637 from InsanusMokrassar/3.0.2
3.0.2
2022-08-06 00:40:46 +06:00
InsanusMokrassar 8b451791dd fixes 2022-08-06 00:39:46 +06:00
InsanusMokrassar 771fb5c288 Update build.gradle 2022-08-05 23:48:15 +06:00
InsanusMokrassar d19ee74f8b Update CHANGELOG.md 2022-08-05 23:47:43 +06:00
InsanusMokrassar aaf489c2ed Update gradle.properties 2022-08-05 23:47:06 +06:00
InsanusMokrassar 1b06b63703 update to hotfix up to 3.0.1 2022-08-05 22:49:32 +06:00
InsanusMokrassar bf7fc25285 make lib dependency implementation instead of api 2022-08-05 22:30:11 +06:00
InsanusMokrassar 4df242747f fix dokka build 2022-08-05 22:03:10 +06:00
InsanusMokrassar e831ca143e Merge pull request #634 from InsanusMokrassar/3.0.0
3.0.0
2022-08-05 21:54:31 +06:00
InsanusMokrassar 44838a2088 optimize imports in behaviour builder common 2022-08-05 21:44:36 +06:00
InsanusMokrassar 3823b03453 fixes 2022-08-05 21:43:15 +06:00
InsanusMokrassar ec48708195 start to fill changelog 2022-08-05 21:27:45 +06:00
InsanusMokrassar 6a06775bc4 add file annotations generation to the class casts 2022-08-05 18:57:50 +06:00
InsanusMokrassar bbdff0b31a rename file with new classcasts 2022-08-05 17:31:45 +06:00
InsanusMokrassar cb4880bd00 optimize imports in utils 2022-08-05 16:35:07 +06:00
InsanusMokrassar a18eda3db6 add generation of class casts 2022-08-05 16:31:39 +06:00
InsanusMokrassar d8f6429385 solution for #636 2022-08-05 11:49:04 +06:00
InsanusMokrassar be74249b67 Update README.md 2022-08-05 01:48:44 +06:00
InsanusMokrassar 69f658e4a8 rewrite hierarchy of forward info classes 2022-08-04 22:45:26 +06:00
InsanusMokrassar 8c51ca9d72 fixes in forward from public chat info 2022-08-04 22:27:40 +06:00
InsanusMokrassar 48c4a3156b fix of build 2022-08-04 18:15:51 +06:00
InsanusMokrassar 92407c9010 remove deprecations from copyMessage 2022-08-04 18:09:25 +06:00
InsanusMokrassar 86937cc096 remove deprecations 2022-08-04 18:01:35 +06:00
InsanusMokrassar ea614b790b update serialization 2022-08-04 17:45:35 +06:00
InsanusMokrassar c994332cb9 update dependencies 2022-08-04 17:18:05 +06:00
InsanusMokrassar 9d893ffa48 start 3.0.0 2022-08-04 17:12:34 +06:00
InsanusMokrassar 57d2fe85c5 Merge pull request #632 from InsanusMokrassar/2.2.2
2.2.2
2022-07-31 19:26:47 +06:00
InsanusMokrassar c68b148d5e inline buildEntities 2022-07-31 18:26:07 +06:00
InsanusMokrassar 0a0a7cea0e fixes in callback query triggers 2022-07-31 17:49:48 +06:00
InsanusMokrassar ea981605f6 start 0.2.2 2022-07-31 17:46:59 +06:00
InsanusMokrassar fe1e65a83c Merge pull request #630 from InsanusMokrassar/2.2.1
2.2.1
2022-07-22 20:00:27 +06:00
InsanusMokrassar c85983bd59 update microutils 2022-07-22 18:45:09 +06:00
InsanusMokrassar d72e1029d3 fill changelog 2022-07-22 16:50:20 +06:00
InsanusMokrassar 4b89563cff fixes in classcasts, withContentOrNull and withContentOrThrow 2022-07-22 16:45:54 +06:00
InsanusMokrassar 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
InsanusMokrassar 6329905f62 Update libs.versions.toml 2022-07-18 14:53:10 +06:00
InsanusMokrassar c54945e4cc Update gradle-wrapper.properties 2022-07-18 14:52:16 +06:00
InsanusMokrassar 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
InsanusMokrassar ca01ce7843 Merge pull request #628 from InsanusMokrassar/tg_channel_imh
Tg Channel QR
2022-07-18 13:44:04 +06:00
root 54fad3f338 Add files via upload 2022-07-18 13:43:06 +06:00
InsanusMokrassar 15ef481fd7 Update README.md 2022-07-18 13:42:17 +06:00
InsanusMokrassar 91e1202674 Delete 68a81ca4-7950-48df-b842-85f285ce3741.jpg 2022-07-18 13:33:23 +06:00
root bdd39963a8 Add files via upload 2022-07-18 13:31:30 +06:00
InsanusMokrassar 01dfedf540 Merge pull request #623 from InsanusMokrassar/2.2.0
2.2.0
2022-07-11 11:18:07 +06:00
InsanusMokrassar 8ded892b72 new class casts 2022-07-11 02:20:28 +06:00
InsanusMokrassar d0b606469b fixes related to owner chat member 2022-07-11 02:05:10 +06:00
InsanusMokrassar 678f79da04 CreatorChatMember -> OwnerChatMember 2022-07-11 01:56:31 +06:00
InsanusMokrassar fde2c79f4c extract force_reply field into constant 2022-07-11 01:43:04 +06:00
InsanusMokrassar acaf46e015 ReplyForce companion improvements 2022-07-11 01:27:28 +06:00
InsanusMokrassar 3f9237b5de flatInlineKeyboard and flatReplyKeyboard 2022-07-11 01:10:35 +06:00
InsanusMokrassar 3d7334dd62 sameChat 2022-07-11 00:57:13 +06:00
InsanusMokrassar 26306f1567 sameMessage 2022-07-11 00:53:20 +06:00
InsanusMokrassar 247553d990 add note about parameters order 2022-07-11 00:45:11 +06:00
InsanusMokrassar 049a8a3263 copy message order of parameters changed 2022-07-11 00:26:57 +06:00
InsanusMokrassar cc67a31e97 start 2.2.0 2022-07-11 00:10:30 +06:00
InsanusMokrassar 8791573145 Update build.gradle 2022-07-10 00:04:36 +06:00
InsanusMokrassar 5752f7a4fb Merge pull request #622 from InsanusMokrassar/2.1.3
2.1.3
2022-07-09 23:54:18 +06:00
InsanusMokrassar ade236eaa3 update microutils 2022-07-09 23:52:16 +06:00
InsanusMokrassar e7340a483a fixes 2022-07-09 23:45:24 +06:00
InsanusMokrassar c7dc69d09f ChatJoinRequest#inviteLink fix 2022-07-09 23:09:52 +06:00
InsanusMokrassar c2487c5adc fixes in links 2022-07-09 22:43:19 +06:00
InsanusMokrassar 7c4808f163 start 2.1.3 2022-07-09 22:37:58 +06:00
InsanusMokrassar b91b516659 Merge pull request #618 from InsanusMokrassar/2.1.2
2.1.2
2022-06-29 14:42:01 +06:00
InsanusMokrassar 57cdc4ff2a fill changelog 2022-06-29 14:27:29 +06:00
InsanusMokrassar 864992aff0 complete rewriting on libs.versions.toml 2022-06-29 14:23:45 +06:00
InsanusMokrassar e18e8ba6df start to use more unified way of scripts organization 2022-06-29 13:47:21 +06:00
InsanusMokrassar 02cedc6626 start 2.1.2 2022-06-29 13:27:35 +06:00
InsanusMokrassar 619b890956 Merge pull request #615 from InsanusMokrassar/2.1.1
2.1.1
2022-06-26 13:42:26 +06:00
InsanusMokrassar 100a76a832 Update CHANGELOG.md 2022-06-26 13:36:13 +06:00
InsanusMokrassar c583ae6761 replace all the edits into one file 2022-06-26 13:18:22 +06:00
InsanusMokrassar 7429ffb514 add TelegramBot#send extensions 2022-06-25 23:06:41 +06:00
InsanusMokrassar 95aeedfb94 Update DeleteMessage.kt 2022-06-25 18:34:41 +06:00
InsanusMokrassar 095e318a78 Update DeleteMessage.kt 2022-06-25 18:04:20 +06:00
InsanusMokrassar 4aa2d2ae41 Update gradle.properties 2022-06-25 03:13:46 +06:00
InsanusMokrassar e936d25c13 TelegramBot#edit 2022-06-25 02:49:38 +06:00
InsanusMokrassar 97a2a5d9fd exists methods of editing text/caption improvements 2022-06-25 02:19:20 +06:00
InsanusMokrassar 00ab532eac start 2.1.1 2022-06-25 02:11:23 +06:00
InsanusMokrassar c2cc6ee1ec Merge pull request #613 from InsanusMokrassar/2.1.0
2.1.0
2022-06-21 23:09:27 +06:00
InsanusMokrassar d20b94e52c rename PremiumChat -> PossiblyPremiumChat 2022-06-21 23:06:36 +06:00
InsanusMokrassar 9f3cc6eafb add mention about 6.1 telegram bot api support 2022-06-21 18:58:01 +06:00
InsanusMokrassar f86a095421 CreateInvoiceLink 2022-06-21 18:52:55 +06:00
InsanusMokrassar b0c6b80d8b small improvements 2022-06-21 18:30:31 +06:00
InsanusMokrassar 1df653f428 SetWebhook#secretToken 2022-06-21 17:55:21 +06:00
InsanusMokrassar 8dfaca7648 CommonUser#addedToAttachmentMenu 2022-06-21 17:52:16 +06:00
InsanusMokrassar 04db76831f add support of premium fields 2022-06-21 17:34:14 +06:00
InsanusMokrassar f2e9bf6bd8 update webapps support 2022-06-21 16:35:48 +06:00
InsanusMokrassar cde8fdeffd start 2.1.0 2022-06-21 15:22:34 +06:00
InsanusMokrassar e74f339ae2 Merge pull request #609 from InsanusMokrassar/2.0.3
2.0.3
2022-06-17 14:34:23 +06:00
InsanusMokrassar ff7702486f downloadFileToTemp 2022-06-17 13:49:44 +06:00
InsanusMokrassar c7818fe4df Update gradle.properties 2022-06-17 11:04:31 +06:00
InsanusMokrassar 8243acd69e regularln 2022-06-17 02:51:22 +06:00
InsanusMokrassar 8081602a39 update microutils 2022-06-17 00:20:30 +06:00
InsanusMokrassar 6fd85dbc56 start 2.0.3 2022-06-17 00:16:23 +06:00
InsanusMokrassar 8d6f4ba136 Merge pull request #602 from InsanusMokrassar/2.0.2
2.0.2
2022-06-05 21:01:10 +06:00
InsanusMokrassar b95b339ad1 Update CHANGELOG.md 2022-06-05 17:40:53 +06:00
InsanusMokrassar 637979100b Update gradle.properties 2022-06-05 17:40:13 +06:00
InsanusMokrassar 4067439a13 update micro_utils 2022-06-04 21:01:40 +06:00
InsanusMokrassar 03583ff6c1 start 2.0.2 2022-06-04 21:00:33 +06:00
InsanusMokrassar c1330f8e32 Merge pull request #598 from InsanusMokrassar/2.0.1
2.0.1
2022-05-29 23:06:15 +06:00
InsanusMokrassar db36c6aacb Update CHANGELOG.md 2022-05-29 22:16:55 +06:00
InsanusMokrassar 757e317e70 Update gradle.properties 2022-05-29 22:15:56 +06:00
InsanusMokrassar cb708a1ba4 Update CHANGELOG.md 2022-05-29 09:03:18 +06:00
InsanusMokrassar 551276f78e Update gradle.properties 2022-05-29 09:02:52 +06:00
InsanusMokrassar 88339a4977 Update CHANGELOG.md 2022-05-28 09:56:40 +06:00
InsanusMokrassar a13371e14c Update gradle.properties 2022-05-28 09:55:10 +06:00
InsanusMokrassar ad7fdc6211 improvements in longPolling extension 2022-05-22 22:36:56 +06:00
InsanusMokrassar c870a48a22 start 2.0.1 2022-05-22 22:35:45 +06:00
InsanusMokrassar 3149fd0231 Merge pull request #597 from InsanusMokrassar/2.0.0
2.0.0
2022-05-22 12:58:46 +06:00
InsanusMokrassar 7430490499 fixes for build 2022-05-22 01:46:11 +06:00
InsanusMokrassar 416187e079 remove deprecations 2022-05-22 01:40:03 +06:00
InsanusMokrassar e7aec75aca removing of filters for the wait triggers 2022-05-22 01:27:52 +06:00
InsanusMokrassar 95a466a08b start 2.0.0 2022-05-21 23:53:45 +06:00
InsanusMokrassar 507cb2af26 cleanup waiters in behaviour builder and add withEvent 2022-05-21 23:38:42 +06:00
InsanusMokrassar 126a07cdc7 start 1.2.0 2022-05-21 23:32:36 +06:00
InsanusMokrassar 27a24a18a6 fix of updates funnel in subsequent behaviour contexts 2022-05-21 21:44:33 +06:00
InsanusMokrassar 562e8c7429 improvements in Beheviour Context 2022-05-21 17:33:44 +06:00
InsanusMokrassar be027efc43 start 1.1.4 2022-05-21 17:27:04 +06:00
InsanusMokrassar e55195b308 Merge pull request #593 from InsanusMokrassar/1.1.3
1.1.3
2022-05-19 13:38:05 -04:00
InsanusMokrassar 14afb59b5f StateHandlingErrorHandler in microutils 2022-05-19 20:37:52 +06:00
InsanusMokrassar 6b23347d56 start 1.1.3 2022-05-19 20:24:55 +06:00
InsanusMokrassar f54843fb60 Merge pull request #592 from InsanusMokrassar/1.1.2
1.1.2
2022-05-18 07:10:31 -04:00
InsanusMokrassar 8a3538d9c7 fixes in relate to main behaviourBuilder fun 2022-05-18 17:05:47 +06:00
InsanusMokrassar e3db4250bb add default copy realization in BehaviourContextWithFSM 2022-05-18 16:52:52 +06:00
InsanusMokrassar 4643ac906a StateHandlingErrorHandler 2022-05-18 16:45:08 +06:00
InsanusMokrassar 497974e45c fix of #591 2022-05-18 16:31:14 +06:00
InsanusMokrassar 78a00f0efb start 1.1.2 2022-05-18 16:27:30 +06:00
InsanusMokrassar 14ecb9d948 Merge pull request #590 from InsanusMokrassar/1.1.1
1.1.1
2022-05-17 09:56:47 -04:00
InsanusMokrassar c759b9a466 deprecate hmac and hex extensions for CryptoJS in webapp 2022-05-17 19:54:13 +06:00
InsanusMokrassar 58c1f2ee6a fixes in TelegramAPIUrlsKeeper#checkWebAppLink 2022-05-17 19:51:14 +06:00
InsanusMokrassar 9d16ca3b7e small refactor of buildBehaviourWithLongPolling 2022-05-16 18:59:30 +06:00
InsanusMokrassar 9d40e598f1 buildBehaciour returns BehaviourContext 2022-05-16 18:58:19 +06:00
InsanusMokrassar f1be8bf16e start 1.1.1 2022-05-16 18:53:15 +06:00
InsanusMokrassar 56a8804e99 Merge pull request #589 from InsanusMokrassar/1.1.0
1.1.0
2022-05-14 12:21:08 +06:00
InsanusMokrassar 1e73aac750 Update Webhook.kt 2022-05-14 02:32:39 +06:00
InsanusMokrassar 82c6eda0b7 Update Webhook.kt 2022-05-14 02:31:36 +06:00
InsanusMokrassar e9ff93cde1 improvements in webhooks 2022-05-14 01:35:38 +06:00
InsanusMokrassar 9b179ea1c9 start 1.1.0 2022-05-14 00:06:32 +06:00
InsanusMokrassar 72d20d2344 Merge pull request #586 from InsanusMokrassar/1.0.1
1.0.1
2022-05-13 00:52:50 +06:00
InsanusMokrassar bcd288fe05 update dependencies 2022-05-12 17:51:42 +06:00
InsanusMokrassar 75477060e9 start 1.0.1 2022-05-12 17:50:04 +06:00
InsanusMokrassar 60df609486 Merge pull request #564 from InsanusMokrassar/1.0.0
1.0.0
2022-05-12 00:05:05 +06:00
InsanusMokrassar 556b492b35 remove redundant changelog part 2022-05-11 19:54:33 +06:00
InsanusMokrassar 53e8c53fb1 extract ReplyKeyboardMarkup fields names to the constants 2022-05-11 12:08:20 +06:00
InsanusMokrassar 69d36c5c1b a little refactor 2022-05-11 11:04:21 +06:00
InsanusMokrassar ad97008f12 refactoring and fixes 2022-05-11 10:56:31 +06:00
InsanusMokrassar 3e58114eeb Update BehaviourWithFSMStateHandlerHolder.kt 2022-05-11 10:30:47 +06:00
InsanusMokrassar d55d8fa000 fixes in behaviour builders 2022-05-11 02:47:00 +06:00
InsanusMokrassar bd32dbb3ab update dependencies note in changelog 2022-05-10 23:59:40 +06:00
InsanusMokrassar 8e0389f032 update microutils 2022-05-10 23:53:05 +06:00
InsanusMokrassar cb37b85234 update previews 2022-05-09 02:27:06 +06:00
InsanusMokrassar df01976ea8 fix of build 2022-05-08 00:39:41 +06:00
InsanusMokrassar 7be74e468b Merge branch 'master' into 1.0.0 2022-05-08 00:38:05 +06:00
InsanusMokrassar 437176203a Merge pull request #584 from InsanusMokrassar/0.38.23
0.38.23
2022-05-08 00:33:27 +06:00
InsanusMokrassar 7b25862035 optimize imports 2022-05-08 00:30:47 +06:00
InsanusMokrassar 45585caab0 fix of #560 2022-05-08 00:28:00 +06:00
InsanusMokrassar 6fea2a12d8 start 0.38.23 2022-05-07 23:26:26 +06:00
InsanusMokrassar ae639d38e0 Merge branch 'master' into 1.0.0 2022-05-05 14:58:07 +06:00
InsanusMokrassar 0510f72859 Merge pull request #583 from InsanusMokrassar/0.38.22
0.38.22
2022-05-05 14:33:59 +06:00
InsanusMokrassar 233c789054 improvements in keyboards and add tgWebAppStartParamField 2022-05-04 23:11:20 +06:00
InsanusMokrassar 52f405c3b1 start 0.38.22 2022-05-04 23:10:31 +06:00
InsanusMokrassar 199856acce Merge pull request #581 from InsanusMokrassar/0.38.21
0.38.21
2022-05-04 13:35:08 +06:00
InsanusMokrassar f36d642ec8 sendDataOrWorkWithQueryId 2022-05-04 13:05:54 +06:00
InsanusMokrassar aa6e5b2284 fix of WebAppInitData#queryId js name 2022-05-04 12:58:06 +06:00
InsanusMokrassar 32b83ac687 start 0.38.21 2022-05-04 12:51:14 +06:00
InsanusMokrassar a2206b99a2 Merge branch 'master' into 1.0.0 2022-05-04 11:13:17 +06:00
InsanusMokrassar 90e0b1ac81 Merge pull request #580 from InsanusMokrassar/0.38.20
0.38.20
2022-05-04 11:11:53 +06:00
InsanusMokrassar 1b5b3af45b add handleResult 2022-05-04 11:01:48 +06:00
InsanusMokrassar 7ff6412ec5 TelegramBot#answerWebAppQuery 2022-05-04 10:51:38 +06:00
InsanusMokrassar bd23d3fbdb hotfixes 2022-05-03 23:12:03 +06:00
InsanusMokrassar 08147fc33b start 0.38.20 2022-05-03 23:11:02 +06:00
InsanusMokrassar ba4c153659 Merge pull request #579 from InsanusMokrassar/0.38.19
0.38.19
2022-05-03 14:36:22 +06:00
InsanusMokrassar 3c3607d817 fill changelog 2022-05-03 14:32:29 +06:00
InsanusMokrassar 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
InsanusMokrassar 3e3adab46b complete fix of issue with subcontexts 2022-05-03 13:58:13 +06:00
InsanusMokrassar 89d13de307 deprecation of BehaviourContextWithFSMBuilder 2022-05-03 10:38:48 +06:00
InsanusMokrassar 32451f4e1c start 0.38.19 2022-05-03 09:44:39 +06:00
InsanusMokrassar 721c3f2430 fix after merge 2022-05-02 14:19:56 +06:00
InsanusMokrassar fc92df8fbe Merge branch 'master' into 1.0.0 2022-05-02 13:50:31 +06:00
InsanusMokrassar ad50f41d1e Merge pull request #578 from InsanusMokrassar/0.38.18
0.38.18
2022-05-02 13:49:24 +06:00
InsanusMokrassar 8c9cd9df67 fix of #577 2022-05-02 13:21:43 +06:00
InsanusMokrassar 8e7f7a03c8 note about xzima help 2022-05-02 12:44:20 +06:00
InsanusMokrassar 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
InsanusMokrassar 33fb75a5eb start 0.38.18 2022-05-02 12:28:39 +06:00
InsanusMokrassar 901c1e8956 Merge pull request #576 from xzima/fix_new_BehaviourContext_ignored
fix: new BehaviourContext ignored
2022-05-02 08:50:20 +06:00
InsanusMokrassar 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
InsanusMokrassar 6f8b881668 replaces of CommonAbstracts 2022-05-01 22:13:40 +06:00
InsanusMokrassar d113d4f0f5 replace ReplyMarkups and api extensions for live locations 2022-05-01 21:33:36 +06:00
InsanusMokrassar dd893b14d3 replaces of live location editing requests 2022-05-01 21:20:31 +06:00
InsanusMokrassar 19ddff2999 MediaGroupUpdates replaces 2022-05-01 21:01:03 +06:00
InsanusMokrassar 7f08fd9d66 replace ParseMode 2022-05-01 20:43:03 +06:00
InsanusMokrassar d3cb44490b TextSources replacements 2022-05-01 20:36:07 +06:00
InsanusMokrassar 4d3cad16a4 Merge branch 'master' into 1.0.0 2022-05-01 17:26:21 +06:00
InsanusMokrassar a52f31f4c9 Merge pull request #575 from InsanusMokrassar/0.38.17
0.38.17
2022-05-01 17:23:33 +06:00
InsanusMokrassar 682f696866 fill changelog 2022-05-01 17:23:12 +06:00
InsanusMokrassar 87fff2e5d0 add BotCommandScope helper extensions 2022-05-01 17:18:44 +06:00
InsanusMokrassar 92b4ba2ff0 fix of #574 2022-05-01 16:50:03 +06:00
InsanusMokrassar 9014cdbc99 start 0.38.17 2022-05-01 16:41:47 +06:00
InsanusMokrassar d0709a509f cleanup in message contents 2022-05-01 11:52:02 +06:00
InsanusMokrassar 0273d07777 update ktor 2022-05-01 11:22:23 +06:00
InsanusMokrassar bafb0c2459 fix incosistences after updating of dependencies 2022-05-01 11:21:01 +06:00
InsanusMokrassar 9be2b899cb Merge branch 'master' into 1.0.0 2022-05-01 11:07:22 +06:00
InsanusMokrassar 37317a1055 Merge pull request #573 from InsanusMokrassar/0.38.16
0.38.16
2022-04-29 23:28:12 +06:00
InsanusMokrassar 60c21002e1 fixes 2022-04-29 19:50:02 +06:00
InsanusMokrassar 78a7a3546a remove checking of webapp data from webapp module due to its existing in core 2022-04-29 19:18:22 +06:00
InsanusMokrassar 4799617ced "TelegramAPIUrlsKeeper" now have two new things: properties "webAppDataSecretKey" and fun "checkWebAppLink" 2022-04-29 19:11:38 +06:00
InsanusMokrassar c70484076d start 0.38.16 2022-04-29 18:56:38 +06:00
InsanusMokrassar 9f451f25f7 update dependencies 2022-04-28 10:40:44 +06:00
InsanusMokrassar 506c2b4a09 Merge branch 'master' into 1.0.0 2022-04-26 15:20:59 +06:00
InsanusMokrassar 0c92e6eeb4 Merge pull request #570 from InsanusMokrassar/0.38.15
0.38.15
2022-04-26 13:45:09 +06:00
InsanusMokrassar efd1c8f83a add additional onDataCallbackQuery variants with regex filters 2022-04-26 13:22:00 +06:00
InsanusMokrassar 7e57a0e4e0 revert update of microutils version 2022-04-26 13:07:16 +06:00
InsanusMokrassar 6b977e67d0 Revert "add telegram update handler"
This reverts commit ab5937449c.
2022-04-26 13:05:56 +06:00
InsanusMokrassar ab5937449c add telegram update handler 2022-04-25 22:28:35 +06:00
InsanusMokrassar 61d3131bf2 update micro_utils 2022-04-25 21:58:25 +06:00
InsanusMokrassar 048f244449 update microutils 2022-04-25 21:19:49 +06:00
InsanusMokrassar 6ebf4ff652 fixes in MessageContent#serializationModule 2022-04-25 21:19:08 +06:00
InsanusMokrassar b4c41d7dd8 start 0.38.15 2022-04-24 18:39:07 +06:00
InsanusMokrassar 6cbe313e42 Merge branch 'master' into 1.0.0 2022-04-23 12:50:12 +06:00
InsanusMokrassar 930507ab80 Merge pull request #568 from InsanusMokrassar/0.38.14
0.38.14
2022-04-23 12:43:02 +06:00
InsanusMokrassar 56d3628dd3 add support of menu buttons 2022-04-23 12:39:14 +06:00
InsanusMokrassar 56d7853f68 update defaults in telegramBot factories 2022-04-23 12:34:38 +06:00
InsanusMokrassar 0a27d9bf28 add shortcuts for telegram and webApp in webapps 2022-04-23 12:34:26 +06:00
InsanusMokrassar c74df3960c fixes in viewport changed events 2022-04-23 12:34:13 +06:00
InsanusMokrassar f4b080cb45 now WebAppData is data class 2022-04-23 12:34:05 +06:00
InsanusMokrassar 350b77f6ff add webAppButton overload with url as string 2022-04-23 12:33:56 +06:00
InsanusMokrassar 955e14f67c add trigger and expectation for WebAppData 2022-04-23 12:33:45 +06:00
InsanusMokrassar ae88b7d94d fix dokka 2022-04-23 12:33:34 +06:00
InsanusMokrassar 88c62bd51c add checking of data in web app 2022-04-23 12:33:23 +06:00
InsanusMokrassar 705bcbe352 webapps 2022-04-23 12:32:39 +06:00
InsanusMokrassar ffcc149c40 update info about supported telegram bot api version 2022-04-23 12:31:37 +06:00
InsanusMokrassar 402d91f9f2 add support of SentWebAppMessage 2022-04-23 12:31:22 +06:00
InsanusMokrassar c19bccc7d1 add support of WebAppInfo 2022-04-23 12:30:35 +06:00
InsanusMokrassar 2c71377058 voice(_c/C)hat* -> video(_c/C)hat* renames 2022-04-23 12:30:15 +06:00
InsanusMokrassar 12d2c05110 add support of WebhookInfo#lastSynchronizationErrorDate 2022-04-23 12:28:40 +06:00
InsanusMokrassar ddf46c1afd add support of ChatAdministratorRights 2022-04-23 12:27:24 +06:00
InsanusMokrassar dd0a8b99c7 add WebAppData 2022-04-23 12:26:28 +06:00
InsanusMokrassar 75fb72936f fix of 563 2022-04-23 12:25:39 +06:00
InsanusMokrassar 1a6a010446 start 0.38.14 2022-04-23 12:24:52 +06:00
InsanusMokrassar 900ef28404 rename InputMedia -> TelegramMedia and replace all InputMedia to media package 2022-04-22 13:54:06 +06:00
InsanusMokrassar a930423955 chats sealing 2022-04-22 00:16:41 +06:00
InsanusMokrassar 323c4de858 replace of ChatMember 2022-04-21 23:24:01 +06:00
InsanusMokrassar cdd5649c04 CallbackQuery package -> queries.callback 2022-04-21 22:42:54 +06:00
InsanusMokrassar 2275a61d73 deprecation of dev.inmo.tgbotapi.bot.Ktor 2022-04-21 21:57:11 +06:00
InsanusMokrassar bf8f4c75f8 update defaults in telegramBot factories 2022-04-21 21:48:25 +06:00
InsanusMokrassar b5334c2b72 fix of #556 2022-04-21 17:54:21 +06:00
InsanusMokrassar 8331d4edd7 fix of #546 2022-04-21 15:42:32 +06:00
InsanusMokrassar 0e6a708eea add shortcuts for telegram and webApp in webapps 2022-04-21 14:49:52 +06:00
InsanusMokrassar fbc5e9f8c4 fixes in viewport changed events 2022-04-21 14:49:52 +06:00
InsanusMokrassar 040a996df6 now WebAppData is data class 2022-04-21 14:49:52 +06:00
InsanusMokrassar cf27600fb5 add webAppButton overload with url as string 2022-04-21 14:49:52 +06:00
InsanusMokrassar 1d42f86623 add trigger and expectation for WebAppData 2022-04-21 14:49:52 +06:00
InsanusMokrassar a9cb07fa0d fix dokka 2022-04-21 14:49:52 +06:00
InsanusMokrassar dd7567f43c add checking of data in web app 2022-04-21 14:49:52 +06:00
InsanusMokrassar d0006bb089 webapps 2022-04-21 14:49:52 +06:00
InsanusMokrassar 7d8b990ec4 remove tgbotapi.extensions.* 2022-04-21 14:49:52 +06:00
InsanusMokrassar 4d20e2cd1c update info about supported telegram bot api version 2022-04-21 14:49:52 +06:00
InsanusMokrassar 4ffe6f915f add support of SentWebAppMessage 2022-04-21 14:49:52 +06:00
InsanusMokrassar 22a7697447 add support of WebAppInfo 2022-04-21 14:49:52 +06:00
InsanusMokrassar ef9941134e voice(_c/C)hat* -> video(_c/C)hat* renames 2022-04-21 14:49:52 +06:00
InsanusMokrassar ba85b8657d add support of WebhookInfo#lastSynchronizationErrorDate 2022-04-21 14:49:52 +06:00
InsanusMokrassar 2dcbc0df32 add support of ChatAdministratorRights 2022-04-21 14:49:52 +06:00
InsanusMokrassar 7bac4a3a32 add support of menu buttons 2022-04-21 14:49:52 +06:00
InsanusMokrassar 63bcc4bcf8 add WebAppData 2022-04-21 14:49:52 +06:00
InsanusMokrassar 643f8e577e fix of #550 2022-04-21 14:49:52 +06:00
InsanusMokrassar 721b82f912 fix of 563 2022-04-21 14:49:52 +06:00
InsanusMokrassar 892aef738d start 1.0.0 🎉 2022-04-21 14:49:52 +06:00
InsanusMokrassar 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
InsanusMokrassar 007112e67a Merge pull request #559 from InsanusMokrassar/0.38.13
0.38.13
2022-04-17 00:26:23 +06:00
InsanusMokrassar a87c21273d BehaviourContext#on*Message extensions 2022-04-17 00:22:00 +06:00
InsanusMokrassar ff2d1615da replace TODO for pipelineStepsHolder with default realization 2022-04-16 23:58:24 +06:00
InsanusMokrassar 08ef146daa Update gradle.properties 2022-04-13 23:12:32 +06:00
InsanusMokrassar a404a6c59c fixes in DownloadFIleChannelRequestCallFactory 2022-04-11 21:56:47 +06:00
InsanusMokrassar 1089c716f3 deprecate StorageFileInfo 2022-04-11 21:00:56 +06:00
InsanusMokrassar 81ad55b19f add KtorPipelineStepsHolder#onRequestReturnResult 2022-04-11 14:41:02 +06:00
InsanusMokrassar 863c872f35 start to add pipelines and fix mention creation 2022-04-11 12:46:33 +06:00
InsanusMokrassar ece6a917ed start 0.38.13 2022-04-11 11:59:37 +06:00
InsanusMokrassar 12248aa702 Merge pull request #555 from InsanusMokrassar/0.38.12
0.38.12
2022-04-09 12:24:57 +06:00
InsanusMokrassar 83ea4f6435 Update gradle.properties 2022-04-08 09:49:06 +06:00
InsanusMokrassar 52204d8df1 Experemtally update kotlin 2022-04-08 09:44:37 +06:00
InsanusMokrassar 81b9ccdf6a Update VideoContent.kt 2022-04-08 09:29:07 +06:00
InsanusMokrassar fa74f12505 Update CHANGELOG.md 2022-04-08 02:09:22 +06:00
InsanusMokrassar be284c4d96 Update dependencies 2022-04-08 02:08:21 +06:00
InsanusMokrassar 1769fcacfd update gradle 2022-04-06 11:45:08 +06:00
InsanusMokrassar 4207d89c92 accumulated updates improvements 2022-04-04 13:16:18 +06:00
InsanusMokrassar 87ee2f280b remove redundant TextedMediaInputMediaContent 2022-04-03 19:56:34 +06:00
InsanusMokrassar 3d458b2dc6 fixes in builds and filling up functionality related to new classes 2022-04-03 19:48:48 +06:00
InsanusMokrassar ee1c7c6533 TextedMediaGroupMediaInput 2022-04-03 19:37:56 +06:00
InsanusMokrassar 97d122c770 TextedMediaContent fixes 2022-04-03 19:29:48 +06:00
InsanusMokrassar 49da0faf45 replies with texted content 2022-04-03 19:21:38 +06:00
InsanusMokrassar d426cb1210 TextedMediaContent 2022-04-03 19:06:27 +06:00
InsanusMokrassar af83ac79e7 start 0.38.12 2022-04-03 18:35:17 +06:00
InsanusMokrassar 602f15c206 Update README.md 2022-04-01 00:01:25 +06:00
InsanusMokrassar c2f40534e6 Update README.md 2022-03-31 23:55:34 +06:00
InsanusMokrassar 5693d4d808 Merge pull request #548 from InsanusMokrassar/0.38.11
0.38.11
2022-03-29 23:40:04 +06:00
InsanusMokrassar 9fe55aa6ef Update CHANGELOG.md 2022-03-29 12:42:02 +06:00
InsanusMokrassar 8f817f1492 reply with any media file 2022-03-29 12:37:54 +06:00
InsanusMokrassar 0fd146655d old matrix and row deprecation 2022-03-29 12:27:03 +06:00
InsanusMokrassar 94e5f74a90 reply with content 2022-03-29 12:20:52 +06:00
InsanusMokrassar b9bffbb71b update dependencies 2022-03-27 13:47:38 +06:00
InsanusMokrassar 5ec5c3bdfd Fixes in "TextSourcesList" creating in from "RawMessageEntities" 2022-03-27 13:44:41 +06:00
InsanusMokrassar a5ed2a82bb start 0.38.11 2022-03-27 13:36:21 +06:00
InsanusMokrassar 1b7dd11e75 Merge pull request #545 from InsanusMokrassar/0.38.10
0.38.10
2022-03-25 10:36:21 +06:00
InsanusMokrassar 8d0307fb7f update github building yml 2022-03-24 16:49:08 +06:00
InsanusMokrassar c500f0a281 update reply and sendPhoto with PhotoSize 2022-03-24 16:47:07 +06:00
InsanusMokrassar b3abeaa5ae Update packages_publishing.yml 2022-03-23 17:03:08 +06:00
InsanusMokrassar 8930a66134 with*Action block called once 2022-03-23 11:48:20 +06:00
InsanusMokrassar 76a2a2ca74 start 0.38.10 2022-03-23 05:06:48 +06:00
InsanusMokrassar 7dff8af460 Update gradle.properties 2022-03-23 05:01:09 +06:00
InsanusMokrassar 5261ab1cf0 start 0.38.10 2022-03-23 05:00:28 +06:00
InsanusMokrassar f45c653fca Merge pull request #544 from InsanusMokrassar/0.38.9
0.38.9
2022-03-22 19:06:29 +06:00
InsanusMokrassar 5e03098ca8 fill changelog 2022-03-22 19:06:02 +06:00
InsanusMokrassar 2a3d8e6e73 publication scripts update 2022-03-22 16:26:18 +06:00
InsanusMokrassar 8c3dac7932 signature clashes fixes 2022-03-21 23:23:19 +06:00
InsanusMokrassar 83fb7f7bcb add opportunity to use several bots in one to serve bots requests 2022-03-21 23:06:23 +06:00
InsanusMokrassar 459414e7dd add RistFeature to SerializationModule 2022-03-21 17:03:37 +06:00
InsanusMokrassar 508d51f5a9 reply with copyMessage 2022-03-20 12:14:26 +06:00
InsanusMokrassar 36f22579b2 add MessageContent.Companion#serializationModule 2022-03-20 11:52:29 +06:00
InsanusMokrassar d3d5f7f2e6 start 0.38.9 2022-03-20 11:50:52 +06:00
InsanusMokrassar 1369680419 Merge pull request #543 from InsanusMokrassar/0.38.8
0.38.8
2022-03-19 21:15:03 +06:00
InsanusMokrassar f6e819be62 simpleFilter to list wrapper 2022-03-19 12:49:14 +06:00
InsanusMokrassar 553da0a3ee update dependencies and fill changelog 2022-03-19 12:27:46 +06:00
InsanusMokrassar bace2724da a little bit refactor MediaGroupTriggers.kt 2022-03-19 10:15:44 +06:00
InsanusMokrassar be710612b5 Update MediaGroupTriggers.kt 2022-03-19 09:55:48 +06:00
InsanusMokrassar ea19c10f41 start 0.38.8 2022-03-18 19:18:34 +06:00
InsanusMokrassar 1b88881c62 Update README.md 2022-03-14 02:50:38 +06:00
InsanusMokrassar be62c4fe37 Merge pull request #540 from InsanusMokrassar/0.38.7
0.38.7
2022-03-12 14:32:20 +06:00
InsanusMokrassar d3499cdde1 update microutils and fill changelog 2022-03-12 13:41:49 +06:00
InsanusMokrassar 01d04f9d2b Update gradle-wrapper.properties 2022-03-11 22:31:19 +06:00
InsanusMokrassar d290992e40 Update gradle.properties 2022-03-11 22:30:52 +06:00
InsanusMokrassar 867bdb8bd7 Update CHANGELOG.md 2022-03-08 00:18:25 +06:00
InsanusMokrassar 5f0a67187f add default votes in SimplePollOption 2022-03-08 00:15:29 +06:00
InsanusMokrassar d9638849e2 update dependencies 2022-03-07 12:44:55 +06:00
InsanusMokrassar 5568720b5b start 0.38.7 2022-03-07 12:44:08 +06:00
InsanusMokrassar c0c591fe08 Merge pull request #535 from InsanusMokrassar/0.38.6
0.38.6
2022-02-27 22:22:04 +06:00
InsanusMokrassar 3c1f8421c9 Update CHANGELOG.md 2022-02-27 10:04:28 +06:00
InsanusMokrassar 35b20d102c Update gradle.properties 2022-02-26 22:01:41 +06:00
InsanusMokrassar 70e6dc8fc9 update dependencies 2022-02-19 23:07:30 +06:00
InsanusMokrassar 4f0de376ab MentionTextSource#username 2022-02-19 23:02:58 +06:00
InsanusMokrassar 10c52c695c start 0.38.6 2022-02-19 22:54:41 +06:00
InsanusMokrassar 2d2c745527 Merge pull request #532 from InsanusMokrassar/0.38.5
0.38.5
2022-02-08 16:53:27 +06:00
InsanusMokrassar 1238843bde update dependencies 2022-02-08 16:50:38 +06:00
InsanusMokrassar 1ebaa1c387 deeplinking fixes and additions 2022-02-07 18:08:06 +06:00
InsanusMokrassar b2bc47ec04 start 0.38.5 2022-02-07 18:00:13 +06:00
root 514620b2bd Merge pull request #530 from InsanusMokrassar/0.38.4
0.38.4
2022-02-02 10:05:11 +06:00
root 054f06e18b Update gradle.properties 2022-02-01 23:39:07 +06:00
InsanusMokrassar 00d467d091 classcasts and raw fields updates 2022-02-01 23:25:22 +06:00
InsanusMokrassar 6426ed6571 fixes 2022-02-01 23:05:47 +06:00
InsanusMokrassar fba6707f44 fixes in create sticker set methods 2022-02-01 17:59:23 +06:00
InsanusMokrassar 0c2fe6bce7 support of Telegram Bot API 5.7 2022-02-01 16:23:26 +06:00
InsanusMokrassar eee9fe439f fix of #529 2022-01-31 17:52:01 +06:00
InsanusMokrassar 3547c09383 start 0.38.4 2022-01-31 17:48:10 +06:00
InsanusMokrassar 956f02d26d Merge pull request #526 from InsanusMokrassar/0.38.3
0.38.3
2022-01-14 16:47:49 +06:00
InsanusMokrassar 468fc0a49b Update CHANGELOG.md 2022-01-14 16:31:57 +06:00
InsanusMokrassar 441f3cee3d Update gradle.properties 2022-01-14 16:31:19 +06:00
InsanusMokrassar 1ea79b9f7f update changelog 2022-01-13 19:01:17 +06:00
InsanusMokrassar 094f88867d Update gradle.properties 2022-01-13 13:52:49 +06:00
InsanusMokrassar 85a8a8eedc update dokka version 2022-01-12 13:02:23 +06:00
InsanusMokrassar 28fce0b4c1 New extensions "TelegramBot#send*" for media groups with contents 2022-01-12 11:39:35 +06:00
InsanusMokrassar 2f5fdcdca0 start 0.38.3 2022-01-12 11:37:34 +06:00
InsanusMokrassar 21799d7e4a add exceptions handling readme 2022-01-11 21:22:10 +06:00
InsanusMokrassar ca409db0ee Merge pull request #525 from InsanusMokrassar/0.38.2
0.38.2
2022-01-10 23:08:50 +06:00
InsanusMokrassar 33c8ee0803 remove redundant copyMessage 2022-01-10 13:48:00 +06:00
InsanusMokrassar 0c0ec22348 update microutils dependency 2022-01-10 13:16:50 +06:00
InsanusMokrassar 24bffbbd97 addopportunity to copy messages using just content 2022-01-10 13:15:10 +06:00
InsanusMokrassar a615d1c4fd copyMessages for media groups 2022-01-10 13:06:18 +06:00
InsanusMokrassar a76b7977b3 start 0.38.2 2022-01-10 12:38:48 +06:00
InsanusMokrassar 6004879aef Merge pull request #524 from InsanusMokrassar/0.38.1
0.38.1
2022-01-07 13:37:06 +06:00
InsanusMokrassar 98ff2558e9 remove redundant dependency in utils 2022-01-07 13:32:34 +06:00
root 61c00b38b1 Update core publish scripts 2022-01-07 13:29:53 +06:00
InsanusMokrassar 2096671147 upfill raw extensions 2022-01-07 12:56:42 +06:00
InsanusMokrassar 094d58f59f upfill of changelog 2022-01-06 17:13:37 +06:00
InsanusMokrassar 578a66b758 fill changelog 2022-01-06 17:00:56 +06:00
InsanusMokrassar b5bb40576b optimize imports of utils 2022-01-06 16:59:15 +06:00
InsanusMokrassar 953638ddf5 add raw fields for CallbackQuery 2022-01-06 16:57:51 +06:00
InsanusMokrassar 1c9ca7a493 add raw fields for ChosenInlineResult 2022-01-06 16:52:28 +06:00
InsanusMokrassar c220412b02 add raw fields for InlineQuery 2022-01-06 16:45:50 +06:00
InsanusMokrassar 41852dde7c add raw fields for polls 2022-01-06 16:42:19 +06:00
InsanusMokrassar 3150cd6a37 fix build 2022-01-06 14:55:07 +06:00
InsanusMokrassar 07de18efd8 update changelog 2022-01-06 14:50:14 +06:00
InsanusMokrassar 9552550198 UserLoggedIn, additions in ClassCasts and partial fix of #511 2022-01-06 14:49:11 +06:00
InsanusMokrassar e1c94f772d MessageCallbackQuery#message now is ContentMessage<MessageContent> 2022-01-06 13:54:22 +06:00
InsanusMokrassar fbed81a1b3 start 0.38.1 2022-01-06 13:49:03 +06:00
InsanusMokrassar b61912d99a Merge pull request #522 from InsanusMokrassar/0.38.0
0.38.0
2022-01-02 03:34:45 +06:00
InsanusMokrassar 5efe74171d Update README.md 2022-01-02 03:33:52 +06:00
InsanusMokrassar 393981560c Update README.md 2022-01-02 03:32:59 +06:00
InsanusMokrassar 73b355df55 fixes 2022-01-02 02:00:22 +06:00
InsanusMokrassar 86885e7698 updates in CommonMessage implementers and removing of deprecations 2022-01-02 01:49:14 +06:00
InsanusMokrassar 4d9be1a995 fix in MessageAutoDeleteTimerChanged 2022-01-02 01:12:41 +06:00
InsanusMokrassar 596176ee93 simple rewrite of spoiler markdown 2022-01-01 20:20:48 +06:00
InsanusMokrassar 2348434048 add support of protect_content in forwardMessage 2022-01-01 20:16:07 +06:00
InsanusMokrassar 5c6a430f38 support of protect_content 2022-01-01 20:13:22 +06:00
InsanusMokrassar 148791ad68 extend InlineQueryResultGif fun with FileId and add ProtectContent + extend SendMessageRequest with it in advance 2022-01-01 13:42:39 +06:00
InsanusMokrassar 5c5a19c91a add spoiler support 2021-12-31 13:48:51 +06:00
InsanusMokrassar bd60c4f411 update gradle wrapper 2021-12-31 12:34:01 +06:00
InsanusMokrassar e5a36225f8 Merge branch 'master' into 0.38.0 2021-12-31 02:55:54 +06:00
InsanusMokrassar bd2c13c178 Merge pull request #515 from InsanusMokrassar/0.37.4
0.37.4
2021-12-30 23:06:15 +06:00
InsanusMokrassar 6f1f94299b fix of build 2021-12-30 12:30:09 +06:00
InsanusMokrassar 72b8231eab update gitignore and dokka version 2021-12-30 11:55:12 +06:00
InsanusMokrassar 323e5fb391 update dependencies 2021-12-30 11:50:58 +06:00
InsanusMokrassar dca5bb40e3 Update MigratedToSupergroup.kt 2021-12-27 23:06:51 +06:00
InsanusMokrassar c21975a150 Merge branch 'master' into 0.37.4 2021-12-27 23:01:45 +06:00
InsanusMokrassar 8675833b99 Update CHANGELOG.md 2021-12-27 22:50:09 +06:00
InsanusMokrassar faf669c035 Update gradle.properties 2021-12-27 22:48:21 +06:00
InsanusMokrassar 2f3a683fa0 Update CHANGELOG.md 2021-12-23 17:24:13 +06:00
InsanusMokrassar 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
InsanusMokrassar 22eac5414c start 0.37.4 2021-12-21 19:13:49 +06:00
InsanusMokrassar 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
InsanusMokrassar fb8cfed382 hotfix 2021-12-20 14:07:45 +06:00
InsanusMokrassar 2de22a08a3 Merge pull request #506 from InsanusMokrassar/0.37.2
0.37.2
2021-12-20 13:00:07 +06:00
InsanusMokrassar e8022a2ded add kdocs to the requests 2021-12-20 12:50:06 +06:00
InsanusMokrassar d6cef5984b filling of changelog and several fixes 2021-12-20 12:47:55 +06:00
InsanusMokrassar 49bea1bcef update gradle wrapper 2021-12-20 12:32:21 +06:00
InsanusMokrassar 85a4459072 Update RawMessage.kt 2021-12-19 00:46:06 +06:00
InsanusMokrassar ce74631580 actualizing of readmes 2021-12-18 23:19:05 +06:00
InsanusMokrassar 1e5ce6bb5c add ContentMessage#hasProtectedContent 2021-12-18 23:12:12 +06:00
InsanusMokrassar dc89e914a1 support of has_protected_content field 2021-12-18 23:11:28 +06:00
InsanusMokrassar ee815c7335 update micro_utils 2021-12-18 22:29:25 +06:00
InsanusMokrassar 69f4033807 add support of is_automatic_forward 2021-12-18 22:28:01 +06:00
InsanusMokrassar 0581587adf add support of has_private_forwards 2021-12-10 12:53:00 +06:00
InsanusMokrassar 23f93075a4 update microutils and add banChatSenderChat and unbanChatSenderChat support 2021-12-10 12:49:13 +06:00
InsanusMokrassar 6c3425d5f9 Update CHANGELOG.md 2021-12-04 21:23:34 +06:00
InsanusMokrassar d285590348 Update gradle-wrapper.properties 2021-12-04 21:12:12 +06:00
InsanusMokrassar 2e0ad6dd3c Merge pull request #505 from InsanusMokrassar/fix/linkln
Fix of linkln
2021-12-04 21:08:46 +06:00
InsanusMokrassar 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
InsanusMokrassar 4e3b085cdb start 0.37.2 2021-12-04 21:07:00 +06:00
InsanusMokrassar 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
InsanusMokrassar e19561367e Merge pull request #500 from InsanusMokrassar/0.37.1
0.37.1
2021-11-14 20:03:57 +06:00
InsanusMokrassar 249efeee7e update scripts 2021-11-14 19:42:03 +06:00
InsanusMokrassar b8cc2421b6 update dependencies 2021-11-14 19:15:09 +06:00
InsanusMokrassar 2fa1a064ec start 0.37.1 2021-11-14 19:14:06 +06:00
InsanusMokrassar 63e864741e update changelog and several kdocs 2021-11-11 12:24:10 +06:00
InsanusMokrassar e4f35c0eba update KDocs 2021-11-11 12:11:58 +06:00
InsanusMokrassar 944fe6d820 Update CHANGELOG.md 2021-11-11 11:14:05 +06:00
InsanusMokrassar 8ea50f36aa Merge pull request #493 from InsanusMokrassar/0.37.0
0.37.0
2021-11-10 14:48:53 +06:00
InsanusMokrassar 17308a6d99 update gradle distro 2021-11-10 13:06:43 +06:00
InsanusMokrassar 6eabea2529 Update CHANGELOG.md 2021-11-09 19:23:41 +06:00
InsanusMokrassar ffe9166fee Update gradle.properties 2021-11-09 19:23:27 +06:00
InsanusMokrassar f1be3e2819 Update README.md 2021-11-09 14:09:20 +06:00
InsanusMokrassar c4c016c438 update common readme 2021-11-09 13:40:38 +06:00
InsanusMokrassar a85e7d7387 fixes 2021-11-09 00:32:04 +06:00
InsanusMokrassar fc59ab0cdd add class casts for ChatInviteLink 2021-11-08 19:15:58 +06:00
InsanusMokrassar 9ed7ded967 fix texts of bot actions 2021-11-08 19:07:02 +06:00
InsanusMokrassar a76a7ae630 add choose_sticker 2021-11-08 18:36:17 +06:00
InsanusMokrassar 4715eb424f add support of join request approving/declining 2021-11-08 18:33:24 +06:00
InsanusMokrassar c24d536d4c add ChatJoinRequest 2021-11-08 18:21:55 +06:00
InsanusMokrassar c969d88bf0 update invite links and add name field 2021-11-08 18:00:43 +06:00
InsanusMokrassar 44e9dc9253 remove deprecations 2021-11-08 17:33:02 +06:00
InsanusMokrassar 10c62bf2c7 chat invite links update 2021-11-08 17:27:15 +06:00
InsanusMokrassar 20b1645935 start migrate fsm part 2021-11-06 21:21:49 +06:00
InsanusMokrassar c5bf9ab1a2 Update CHANGELOG.md 2021-11-05 22:04:55 +06:00
InsanusMokrassar cd6d108a9a Update gradle.properties 2021-11-05 22:03:42 +06:00
InsanusMokrassar 5369a85faa update dependencies 2021-11-03 17:31:24 +06:00
InsanusMokrassar 45a895f32f start 0.36.2 2021-11-03 17:29:10 +06:00
InsanusMokrassar 8c1d7203d2 Merge pull request #487 from InsanusMokrassar/0.36.1
0.36.1
2021-10-23 23:08:09 +06:00
InsanusMokrassar 7394a6e94b update microutils 2021-10-23 14:36:13 +06:00
InsanusMokrassar 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
InsanusMokrassar 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
InsanusMokrassar db956a803c Update CHANGELOG.md 2021-10-22 23:51:47 +06:00
InsanusMokrassar aeb131b2f4 Update gradle.properties 2021-10-22 23:51:13 +06:00
InsanusMokrassar 6d80c2bddc Update README.md 2021-10-20 22:14:34 +06:00
InsanusMokrassar 6e32d4e863 update behaviour builder fsm readme 2021-10-18 20:08:55 +06:00
InsanusMokrassar 6b62070447 Merge pull request #474 from InsanusMokrassar/0.36.0
0.36.0
2021-10-18 17:13:30 +06:00
InsanusMokrassar ad8710db92 add telegraph note 2021-10-18 16:43:37 +06:00
InsanusMokrassar f385101e22 deprecate several behaviour builder methods 2021-10-18 15:48:24 +06:00
InsanusMokrassar 15386a63f9 small fix 2021-10-18 15:38:42 +06:00
InsanusMokrassar 576b25190a cleanup 'extension' suffix in readmes 2021-10-18 15:37:10 +06:00
InsanusMokrassar dd979d8626 update publish scripts of old packages 2021-10-18 15:23:43 +06:00
InsanusMokrassar e60eb68b67 packages update 2021-10-18 15:20:25 +06:00
InsanusMokrassar 91212eaa3a resolution of #484 2021-10-18 14:45:57 +06:00
InsanusMokrassar 65c1f018ac update microutils 2021-10-18 14:13:22 +06:00
InsanusMokrassar 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
InsanusMokrassar ddd32a81c0 Update CHANGELOG.md 2021-10-16 08:54:53 +06:00
InsanusMokrassar db7a42fa9b Update gradle.properties 2021-10-16 08:54:36 +06:00
InsanusMokrassar 5e2df1cb4a a little fill of Readme for fsm behaviour builder 2021-10-15 18:24:06 +06:00
InsanusMokrassar 21c0e375f5 update kdocs of BehaviourContextWithFSM 2021-10-15 17:55:13 +06:00
InsanusMokrassar 4ac01d0104 update onSuccessPayment kdocs 2021-10-15 17:40:32 +06:00
InsanusMokrassar 9c15410c4e update kdoc of telegramBotWithBehaviourAndFSMAndStartLongPolling 2021-10-15 17:37:14 +06:00
InsanusMokrassar c5ff0dbc54 fixes 2021-10-15 17:13:03 +06:00
InsanusMokrassar 19d221fc29 fixes 2021-10-15 16:37:20 +06:00
InsanusMokrassar 179a724d20 several actualizations for behaviour builder with fsm 2021-10-15 16:28:17 +06:00
InsanusMokrassar ad9bc36f8c all triggers in behaviour builder now use accumulator flow 2021-10-14 23:05:11 +06:00
InsanusMokrassar 5a192b00d4 refactor of contentConverter 2021-10-14 22:57:04 +06:00
InsanusMokrassar 2a33b22afb BehaviourBuilder FSM extension 2021-10-13 14:22:01 +06:00
InsanusMokrassar db1e01688d Update FUNDING.yml 2021-10-05 23:52:03 +06:00
InsanusMokrassar 22e71354dd update dokka 2021-10-05 17:27:50 +06:00
InsanusMokrassar 2e560db865 update microutils 2021-10-05 17:08:19 +06:00
InsanusMokrassar 016fc81b71 update microutils 2021-10-04 15:56:30 +06:00
InsanusMokrassar b6e72c2399 rename poll updates triggers and fill changelog 2021-10-03 21:16:31 +06:00
InsanusMokrassar e1e2b93269 deprecate waitEditedPoll and rename poll updates waiters 2021-10-03 21:14:28 +06:00
InsanusMokrassar 834e31906a deprecate onEditPoll and rename poll updates triggers 2021-10-03 21:12:17 +06:00
InsanusMokrassar 5831cc6d37 hotfix for autorenames -.- 2021-10-03 20:40:42 +06:00
InsanusMokrassar 0cce72de8d cover all updates in behaviour builder 2021-10-03 20:37:14 +06:00
InsanusMokrassar 3919359f79 CommonGroupEvent -> PublicChatEvent 2021-10-03 18:44:29 +06:00
InsanusMokrassar e51a4b7702 SuccessfulPaymentEvent 2021-10-03 11:53:54 +06:00
InsanusMokrassar 702c1bc1ff fix build 2021-10-02 00:52:29 +06:00
InsanusMokrassar 6557e8af10 upfixes in changelog 2021-10-01 20:07:14 +06:00
InsanusMokrassar edcebb03c0 add note about deprecation of PayInlineKeyboardButton 2021-10-01 19:57:03 +06:00
InsanusMokrassar 9a3fc19992 update packages_publish workflow 2021-10-01 19:42:12 +06:00
InsanusMokrassar 7f9faa69c8 new dsls for keyboards #472 2021-10-01 19:38:51 +06:00
InsanusMokrassar 5b98c5f821 update dependencies 2021-10-01 16:40:04 +06:00
InsanusMokrassar 40bd8d0987 update dependencies 2021-10-01 15:46:07 +06:00
InsanusMokrassar 2aa6497374 start 0.36.0 2021-10-01 15:45:37 +06:00
InsanusMokrassar b9cb7b62fa setup toolchain for java targets 2021-09-23 13:15:44 +06:00
InsanusMokrassar 04679beb52 Update packages_publishing.yml 2021-09-22 20:15:48 +06:00
InsanusMokrassar 64e9289afb Delete build.yml 2021-09-22 20:14:58 +06:00
InsanusMokrassar d4f24ee0cd Merge pull request #461 from InsanusMokrassar/0.35.9
0.35.9
2021-09-21 23:17:32 +06:00
InsanusMokrassar 3e5d939ea5 factory functions of BehaviourContextReceiver's, updates in kdocs and operations for these receivers filters 2021-09-21 21:36:52 +06:00
InsanusMokrassar 24f91e4aee Fix of #464 2021-09-21 20:50:59 +06:00
InsanusMokrassar fe169fafaf add kdocs to LocationContent 2021-09-21 18:57:12 +06:00
InsanusMokrassar aeb6fad409 add LocationContent#copy 2021-09-21 18:49:29 +06:00
InsanusMokrassar 94ad758814 deprecate old API in Behaviour Builder 2021-09-21 18:39:05 +06:00
InsanusMokrassar 5f01e26377 Update CHANGELOG.md 2021-09-21 16:24:12 +06:00
InsanusMokrassar f82ac0ce9d Update gradle.properties 2021-09-21 16:23:47 +06:00
InsanusMokrassar c8491765e9 update dependencies 2021-09-19 15:27:01 +06:00
InsanusMokrassar 53a3e11836 fix CustomBotAction annotations 2021-09-17 16:50:54 +06:00
InsanusMokrassar fcccbe3252 Update CHANGELOG.md 2021-09-17 09:17:48 +06:00
InsanusMokrassar 584bf06109 Update gradle.properties 2021-09-17 09:17:28 +06:00
InsanusMokrassar ef0083079e Update gradle.properties 2021-09-16 10:09:28 +06:00
InsanusMokrassar 0d01e9bc78 add kdocs for filters 2021-09-15 15:07:38 +06:00
InsanusMokrassar 89aef3d77b kdocs for triggers in behaviour builder 2021-09-15 14:58:45 +06:00
InsanusMokrassar 24c47b00d4 BehaviourContext#followLocation 2021-09-14 16:16:06 +06:00
InsanusMokrassar a046a72392 waitEditedContent* extensions 2021-09-14 16:04:58 +06:00
InsanusMokrassar a5a530c9bd TelegramBot#answer 2021-09-14 15:51:05 +06:00
InsanusMokrassar 9cf82a3564 subcontext filter and inBlock filter in behaviour context triggers 2021-09-13 23:30:01 +06:00
InsanusMokrassar 46cc37be62 LocationContent -> LiveLocationContent / StaticLocationContent 2021-09-12 17:15:58 +06:00
InsanusMokrassar 1fbaf396aa update micro_utils 2021-09-12 15:48:33 +06:00
InsanusMokrassar 76985501f5 CustomBotAction 2021-09-12 15:32:36 +06:00
InsanusMokrassar 8d8bcfba01 start 0.35.9 2021-09-12 15:29:19 +06:00
InsanusMokrassar e0f3957249 Update CHANGELOG.md 2021-09-09 00:42:57 +06:00
InsanusMokrassar 3f1b018808 Merge pull request #457 from InsanusMokrassar/0.35.8
0.35.8
2021-09-08 22:43:23 +06:00
906 changed files with 34118 additions and 10817 deletions

No files matched your search

+1 -3
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']
+5 -3
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"
-12
View File
@@ -1,12 +0,0 @@
name: Build
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
- name: Build
run: ./gradlew build
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
java-version: 11
- name: Build
run: ./gradlew dokkaHtml
- name: Publish KDocs
+1
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:
+5 -2
View File
@@ -7,15 +7,18 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-java@v1
with:
java-version: 1.8
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
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel -x signJsPublication -x signJvmPublication -x signKotlinMultiplatformPublication
continue-on-error: true
run: ./gradlew publishAllPublicationsToGithubPackagesRepository --no-parallel
env:
GITHUBPACKAGES_USER: ${{ github.actor }}
GITHUBPACKAGES_PASSWORD: ${{ secrets.GITHUB_TOKEN }}
+1
View File
@@ -10,4 +10,5 @@ build/
out/
local.properties
kotlin-js-store/
secret.gradle
+763 -2
View File
@@ -1,5 +1,767 @@
# TelegramBotAPI changelog
## 4.0.0
## 3.3.1
* `Versions`:
* `Ktor`: `2.1.2` -> `2.1.3`
* `Klock`: `3.2.0` -> `3.3.1`
* `MicroUtils`: `0.13.1` -> `0.13.2`
* `Utils`:
* New extensions on `CommonMessage`: `hasCommands` and `hasNoCommands`. Useful for the `initialFilter` parameter in behaviour builder triggers.
## 3.3.0
**THIS VERSION CONTAINS UPGRADE KOTLIN (AND ALL RELATED LIBRARIES) UP TO 1.7.20**
* `Versions`:
* `Kotlin`: `1.7.10` -> `1.7.20`
* `Kotlin Serialization`: `1.4.0` -> `1.4.1`
* `Korlibs`: `3.1.0` -> `3.2.0`
* `MicroUtils`: `0.12.17` -> `0.13.1`
* `Core`:
* Add opportunity to create command text source and add command in entities builder
via `BotCommamd` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
* `API`:
* New extensions `TelegramBot#getStickerSetOrNull` and `TelegramBot#getStickerSetOrThrow`
* Old `TelegramBot#getStickerSet` has been deprecated
* `Behaviour Builder`:
* Add opportunity to use triggers and waiters with `BotCommand` (thanks to [d1shin](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/664))
## 3.2.7
* `Versions`:
* `MicroUtils`: `0.12.13` -> `0.12.17`
* `Ktor`: `2.1.1` -> `2.1.2`
* `Utils`:
* Next classes become typealiases instead of classes:
* `ReplyKeyboardBuilder`
* `ReplyKeyboardRowBuilder`
* `InlineKeyboardBuilder`
* `InlineKeyboardRowBuilder`
## 3.2.6
* `Core`:
* Fixes in `ChatMemberSerializer#serialize` method
* Migration of `EntitiesBuilder` from `Utils` to `Core`
* `API`:
* All the extensions related to text messages (replies, sending, editing) got their duplicates with `buildEntities` lambda and separator
* `Utils`:
* Migration of `EntitiesBuilder` from `Utils` to `Core`
## 3.2.5
* `Common`:
* Improve support of new exceptions recovering mechanism
## 3.2.4
* `API`:
* New `edit`'s with chats and message ids
## 3.2.3
* `Core`:
* Fixes in `DeleteMyCommands`
## 3.2.2
* `Versions`:
* `MicroUtils`: `0.12.10` -> `0.12.13`
* `Core`:
* `MessageIdentifier` has been renamed to `MessageId`
* `API`:
* New `reply`'es with chats and message ids
## 3.2.1
* `Versions`:
* `Ktor`: `2.1.0` -> `2.1.1`
* `Korlibs`: `3.0.0` -> `3.1.0`
* `MicroUtils`: `0.12.4` -> `0.12.10`
## 3.2.0
**Since this update, `RequestsExecutor#execute` may throw only `BotException`. In case you wish to handle some exceptions from `execute` you must catch `BotException` and handle its `cause`**
* `Versions`:
* `Serialization`: `1.4.0-RC` -> `1.4.0`
* `MicroUtils`: `0.12.1` -> `0.12.4`
* `Core`:
* `SetWebhook#allowedUpdates` now is `ALL_UPDATES_LIST` by default instead of `null`
* `API`:
* Extension `TelegramBot#setWebhook` parameter `allowedUpdates` now is `ALL_UPDATES_LIST` by default instead of `null`
* `Utils`:
* All related to long polling extensions parameters `allowedUpdates` now are `ALL_UPDATES_LIST` by default instead of `null`
## 3.1.1
* `Common`:
* Complete Bot API 6.2 implementation
## 3.1.0
**This update contains including of Bot API 6.2**
* `Versions`:
* `Ktor`: `2.0.3` -> `2.1.0`
* `MicroUtils`: `0.12.0` -> `0.12.1`
* `Core`:
* Add support of `custom emoji`s
* Add support of `sticker_type`
## 3.0.2
**ALL OLD DEPRECATIONS HAVE BEEN REMOVED**
**`copyMessage` HAVE CHANGED THEIR SIGNATURE BY SWAPPING FROM AND TO CHAT IDS**
* `Versions`:
* `Kotlin`: `1.6.21` -> `1.7.10`
* `Serialization`: `1.3.3` -> `1.4.0-RC`
* `Korlibs`: `2.7.0` -> `3.0.0`
* `UUID`: `0.4.1` -> `0.5.0`
* `MicroUtils`: `0.11.13` -> `0.12.0`
* `Core`:
* Interface `ReplyMakrup` has been renamed to `WithReplyMarkup` to correspond its purpose
* Data class `LeftChatMember` has been renamed to `LeftChatMemberEvent` to avoid type ambiguite with the other `LeftChatMember`
* `ForwardInfo` hierarchy has been fully reworked:
* `AnonymousForwardInfo` -> `ForwardInfo.ByAnonymous`
* `UserForwardInfo` -> `ForwardInfo.ByUser`
* `ForwardFromPublicChatInfo` -> `ForwardInfo.PublicChat`
* `ForwardFromChannelInfo` -> `ForwardInfo.PublicChat.FromChannel`
* `ForwardFromSupergroupInfo` -> `ForwardInfo.PublicChat.FromSupergroup`
* `ForwardInfo.PublicChat.SentByChannel` ___has been created___
* `API`:
* Add new `Flow`-based live locations API
* Add `sendLocation` for sending live locations
* `Utils`:
* **BREAKING CHANGES** Now all new classcasts (like `Chat.ifPrivateChat` etc.) have been rewritten to be generated with `ksp` and `kotlin poet`
*Note: Versions 3.0.0 and 3.0.1 have been published with errors and didn't recommend to use*
## 2.2.2
* `Utils`:
* `buildEntities` now is inline
* `Behaviour Builder`:
* Fixes in `CallbackQuery` triggers
## 2.2.1
* `Versions`:
* `Coroutines`: `1.6.3` -> `1.6.4`
* `MicroUtils`: `0.11.12` -> `0.11.13`
* `Core`:
* New `typealiase`s for `CommonMessage` with all supported content types, more info: [PR](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/629)
* `Utils`:
* New extensions for all types of messages `*.withContentOrNull` and `*.withContentOrThrow` as analogies to the same ones from class casts
## 2.2.0
* `Core`:
* For `CopyMessage` order of parameters has been changed
* `ReplyForce` defaults changes:
* All old companion properties (like `ReplyForce.ReplyForceSelective`) have been renamed:
* `ReplyForceSelective` -> `Selective`
* `ReplyForceNonSelective` -> `NonSelective`
* `ReplyForceDefault` -> `Default`
* New companion functions:
* `ReplyForce#Selective`
* `ReplyForce#NonSelective`
* Rename `CreatorChatMember` -> `OwnerChatMember`
* `API`:
* For `copyMessage` order of parameters has been changed
* `Utils`:
* New extension `Message#sameChat`
* New extension `Message#sameMessage`
* New functions `flatInlineKeyboard` and `flatReplyKeyboard`
* Experimentally add new triple of class casts: `if*`, `*OrNull` and `*OrThrow`
## 2.1.3
* `Versions`:
* `MicroUtils`: `0.11.9` -> `0.11.12`
* `Utils`:
* Rename `UserId` extension `link` to `userLink`
* `Core`
* `ChatJoinRequest#inviteLink` is nullable due to the fact that join requests without link do not require invite link
## 2.1.2
* `Versions`:
* `Coroutines`: `1.6.1` -> `1.6.3`
* `Ktor`: `2.0.2` -> `2.0.3`
* `MicroUtils`: `0.11.6` -> `0.11.9`
## 2.1.1
* `API`:
* Now it is possible to edit any message text via `editMessageText` (but with warning)
* Now it is possible to edit any message caption via `editMessageCaption` (but with warning)
* Media message caption edit method (`editMessageCaption`) now returns the message with the same generic type (as it must be in telegram system)
* New extensions `TelegramBot#edit` has been added for all possible editions types
* New extensions `TelegramBot#send` has been added for all possible sending types
* New extensions `TelegramBot#delete` has been added
* `Versions`:
* `MicroUtils`: `0.11.3` -> `0.11.6`
## 2.1.0
__This update contains including of [Telegram Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)__
* Add support of functionality for `WebApp`s from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
* Add support of functionality for premium feature from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
* Add support of `addedToAttachmentMenu` in `CommonUser` from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
* Add support of `secret_token` in `SetWebhook` request from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
* Add support of `createInvoiceLink` request from [Bot API 6.1](https://core.telegram.org/bots/api-changelog#june-20-2022)
## 2.0.3
* `Core`:
* New function `regularln` for simple creating of `RegularTextSource` with new line in the end
* `API`:
* New function `downloadFileToTemp` for simple downloading of file in filesystem and manipulation with avoiding of direct using input streams and other low-level things
* `Versions`:
* `MicroUtils`: `0.11.0` -> `0.11.3`
## 2.0.2
* `Versions`:
* `MicroUtils`: `0.10.8` -> `0.11.0`
* `UUID`: `0.4.0` -> `0.4.1`
## 2.0.1
* `Versions`:
* `Ktor`: `2.0.1` -> `2.0.2`
* `MicroUtils`: `0.10.5` -> `0.10.8`
* `Utils`:
* `TelegramBot#longPolling` now accepts `UpdatesFilter` instead of `FlowsUpdatesFilter`
## 2.0.0
___ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED___
* `Behaviour Builder`:
* Mappers have been removed from waiters extensions
* Triggers extensions now will use filtering inside of context receiver instead of passing the filters into `BehaviourContext`. That means that in the subcontext will not be used preinstalled filters for their `BehaviourContext` and filter of trigger will not be used in subcontext
* Waiters do not take count parameter anymore
* Waiters do not take filter parameter anymore. Use flows filters
* `Utils`:
* Add opportunity to get event messages with specific `ChatEvent` type using `withEvent`/`requireWithEvent` (by analog with `withEvent` and `requireWithEvent`)
## 1.1.3
* `Behaviour Builder with FSM`:
* Typealias `StateHandlingErrorHandler` from `1.1.2` has been deprecated and should be replaced with the new one from microutils
## 1.1.2
* `Core`:
* Rename of `TelegramAPIUrlsKeeper#checkWebAppLink` -> `TelegramAPIUrlsKeeper#checkWebAppData` (fix of [#591](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/591))
* `Behaviour Builder with FSM`:
* New typealias `StateHandlingErrorHandler`
* `BehaviourBuilderWithFSM` now accepts new parameter `onStateHandlingErrorHandler` which will be used in case if state has not been successfully completed
## 1.1.1
* `Versions`:
* `MicroUtils.Crypto` will not be provided with that library anymore. Instead, it is recommended to use `Korlibs.Krypto`. You still can add crypto from microutils using next groovy dependency: `dev.inmo:micro_utils.crypto:$micro_utils_version`
* `Core`:
* Improvements in `TelegramAPIUrlsKeeper#checkWebAppLink`
* New field in `TelegramAPIUrlsKeeper#webAppDataSecretKeyHash`
* `Behaviour Builder`:
* Extension `TelegramBot#buildBehaviour` now returns `BehaviourContext`
## 1.1.0
* `Utils`:
* New parameter `additionalApplicationEngineEnvironmentConfigurator` in `RequestsExecutor#setWebhookInfoAndStartListenWebhooks` and `startListenWebhooks`
## 1.0.1
* `Versions`:
* `Serialization`: `1.3.2` -> `1.3.3`
* `MicroUtils`: `0.10.3` -> `0.10.4`
## 1.0.0
__All the `tgbotapi.extensions.*` packages have been removed__
* `Versions`:
* `Kotlin`: `1.6.10` -> `1.6.21`
* `Ktor`: `1.6.8` -> `2.0.1`
* `MicroUtils`: `0.9.24` -> `0.10.3`
* `Core`:
* **`Ktor` package renamed. Migration:** `dev.inmo.tgbotapi.bot.Ktor` -> `dev.inmo.tgbotapi.bot.ktor`
* **`CallbackQuery` package renamed. Migration:** `dev.inmo.tgbotapi.types.CallbackQuery([\s\\.])` -> `dev.inmo.tgbotapi.types.queries.callback$1`
* **`ChatMember` package renamed. Migration:** `dev.inmo.tgbotapi.types.ChatMember([\s\\.])` -> `dev.inmo.tgbotapi.types.chat.member$1`
* **`ChatAdministratorRightsImpl` replaced. Migration:** `dev.inmo.tgbotapi.types.ChatAdministratorRightsImpl` -> `dev.inmo.tgbotapi.types.chat.member.ChatAdministratorRightsImpl`
* **`chat.abstract.extended` replaced. Migration:** `dev.inmo.tgbotapi.types.chat.abstract.extended` -> `dev.inmo.tgbotapi.types.chat.member.chat`
* **`chat.abstract` replaced. Migration:** `dev.inmo.tgbotapi.types.chat.abstract` -> `dev.inmo.tgbotapi.types.chat.member.chat`
* **`chat.extended` replaced. Migration:** `dev.inmo.tgbotapi.types.chat.extended` -> `dev.inmo.tgbotapi.types.chat.member.chat`
* **User interfaces have been fully replaced**:
* `dev.inmo.tgbotapi.types.User` -> `dev.inmo.tgbotapi.types.chat.User`
* `dev.inmo.tgbotapi.types.CommonUser` -> `dev.inmo.tgbotapi.types.chat.CommonUser`
* `dev.inmo.tgbotapi.types.ExtendedUser` -> `dev.inmo.tgbotapi.types.chat.ExtendedUser`
* `dev.inmo.tgbotapi.types.Bot` -> `dev.inmo.tgbotapi.types.chat.Bot`
* `dev.inmo.tgbotapi.types.CommonBot` -> `dev.inmo.tgbotapi.types.chat.CommonBot`
* `dev.inmo.tgbotapi.types.ExtendedBot` -> `dev.inmo.tgbotapi.types.chat.ExtendedBot`
* `dev.inmo.tgbotapi.types.UserSerializer` -> `dev.inmo.tgbotapi.types.chat.UserSerializer`
* **All `InputMedia` has been renamed as `TelegramMedia`. Migration:** `InputMedia` -> `TelegramMedia`
* `dev.inmo.tgbotapi.types.InputMedia` -> `dev.inmo.tgbotapi.types.media`
* **Replaces of `MessageContent`. Migrations:**
* `dev.inmo.tgbotapi.types.message.content.abstracts` -> `dev.inmo.tgbotapi.types.message.content`
* `dev.inmo.tgbotapi.types.message.content.media` -> `dev.inmo.tgbotapi.types.message.content`
* **Replaces of `TextSource`s. Migrations:** `dev.inmo.tgbotapi.types.MessageEntity.textsources` -> `dev.inmo.tgbotapi.types.message.textsources`
* **Replaces of `ParseMode`s. Migrations:** `dev.inmo.tgbotapi.types.ParseMode` -> `dev.inmo.tgbotapi.types.message`
* **Replaces of `MediaGroupUpdate`s. Migrations:** `dev.inmo.tgbotapi.types.update.MediaGroupUpdates` -> `dev.inmo.tgbotapi.types.update.media_group`
* **`InvoiceContent` has been replaced: `dev.inmo.tgbotapi.types.message.payments.InvoiceContent` -> `dev.inmo.tgbotapi.types.message.content.InvoiceContent`**
* **`PossiblySentViaBotCommonMessage` has been replaced: `dev.inmo.tgbotapi.types.message.content.abstracts.PossiblySentViaBotCommonMessage` -> `dev.inmo.tgbotapi.types.message.abstracts.PossiblySentViaBotCommonMessage`**
* **Edit live location requests have been replaced:**
* `dev.inmo.tgbotapi.requests.edit.LiveLocation` -> `dev.inmo.tgbotapi.requests.edit.location.live`
* `dev.inmo.tgbotapi.extensions.api.edit.LiveLocation` -> `dev.inmo.tgbotapi.extensions.api.edit.location.live`
* **Edit reply markup requests have been replaced:**
* `dev.inmo.tgbotapi.requests.edit.ReplyMarkup` -> `dev.inmo.tgbotapi.requests.edit.reply_markup`
* `dev.inmo.tgbotapi.extensions.api.edit.ReplyMarkup` -> `dev.inmo.tgbotapi.extensions.api.edit.reply_markup`
* **Common abstracts have been replaced: `dev.inmo.tgbotapi.CommonAbstracts` -> `dev.inmo.tgbotapi.abstracts`**
* Constructor of `UnknownInlineKeyboardButton` is not internal and can be created with any `json` ([#563](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/563))
* All the interfaces from `dev.inmo.tgbotapi.types.files.abstracts` have been replaced to `dev.inmo.tgbotapi.types.files` and converted to sealed ([#550](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/550))
* `PassportFile` has been replaced to `dev.inmo.tgbotapi.types.files`
* `StorageFile` has been deprecated (fix of [#556](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/556))
* `MultipartFile` do not require `StorageFile` anymore
* `InputFile` companion got functions to simplify creation of `InputFile`s
* New typealias `FileUrl` (represents `FileId` but declare that they are the same)
* `BehaviourBuilder`:
* `SimpleFilter` now is a `fun interface` instead of just callback (fix of [#546](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/546))
* New extension `BehaviourContext#createSubContext`. It uses separated `AccumulatorFlow` and will retrieve updates by itself
* New extension `BehaviourContext#doInContext`
* Extension `BehaviourContext#doInSubContextWithUpdatesFilter` has been renamed to `BehaviourContext#createSubContextAndDoWithUpdatesFilter`
* Extension `BehaviourContext#doInSubContext` has been deprecated
* `BehaviourContextWithFSM`:
* `launchStateHandling` lost its parameter `contextUpdatesFlow: Flow`
* `handleState` of `BehaviourContextWithFSM` now will get/create sub context for the state and launch handling in it
* `BehaviourWithFSMStateHandler` now extends `StatesHandler`
* `BehaviourWithFSMStateHandlerHolder` now extends `CheckableHandlerHolder` and `BehaviourWithFSMStateHandler`
* Function `checkHandleable` of `BehaviourWithFSMStateHandlerHolder` now is `suspend`
## 0.38.23
* `BehaviourHandler`:
* Add support of fallback triggers (fix of [#560](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/560))
## 0.38.22
* `Core`:
* New constant `tgWebAppStartParamField`
* All keyboards builders and rows blocks becomes not crossinline
## 0.38.21
* `WebApps`:
* `WebAppInitData#queryId` now have correct js name of field
* New function `sendDataOrWorkWithQueryId`
## 0.38.20
* `BehaviourBuilder FSM`:
* Hotfixes
* `WebApps`:
* New extension `TelegramBot#answerWebAppQuery`
* New function `handleResult`
## 0.38.19
* `BehaviourBuilder`:
* Hotfixes
* `BehaviourBuilder FSM`:
* `BehaviourContextWithFSMBuilder` deprecated in favor to `BehaviourContextWithFSM`
* Now it is possible to define additional handlers in subcontexts of `BehaviourBuilderWithFSM`
## 0.38.18
* `Core`:
* Add support of test servers (fix of [#577](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/577))
* `BehaviourBuilder`:
* Fixes in extension `BehaviourContext#doInSubContextWithUpdatesFilter` (thanks to [xzima](https://github.com/xzima))
## 0.38.17
* `Core`:
* Add `BotCommandScopeChat` as new `BotCommandScope` (fix of [#574](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/574))
* `BotCommandScope` companion got several properties and functions for more useful scope creation
## 0.38.16
* `Core`:
* `TelegramAPIUrlsKeeper` now have two new things: properties `webAppDataSecretKey` and fun `checkWebAppLink`
## 0.38.15
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.20` -> `0.9.24`
* `Core`:
* Fixes in `MessageContent#serializationModule`
* `BehaviourBuilder`:
* Add triggers for `DataCallbackQuery` and subtypes with regex checking of data
## 0.38.14
__This update contains including of [Telegram Bot API 6.0](https://core.telegram.org/bots/api-changelog#april-16-2022)__
* `Core`:
* Constructor of `UnknownInlineKeyboardButton` is not internal and can be created with any `json`
* `WebApps`:
* Created 🎉
## 0.38.13
* `Core`:
* Fixes in `mention` creation
* Deprecate `StorageFileInfo`
* `BehaviourBuilder`:
* In the expectations a lot of `on*Message` extensions have been added (like `onContentMessage`). These extensions could be useful when with the `Content` its message info is important
## 0.38.12
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.17` -> `0.9.19`
* `Coroutines`: `1.6.0` -> `1.6.1`
* `Core`:
* New type `TextedMediaContent` which will unite `TextedInput` and `MediaContent`
* `MediaGroupContent` and all subsequent inheritors have been replaced to the package `dev.inmo.tgbotapi.types.message.content.media`
* `MediaGroupContent` Now extends `TextedMediaContent` instead of `MediaContent`
* Add `reply` functions with the texted content with including of text
* `Utils`:
* Improve work with retrieving of accumulated updates
## 0.38.11
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.16` -> `0.9.17`
* `Klock`: `2.6.3` -> `2.7.0`
* `Core`:
* Fixes in `TextSourcesList` creating in from `RawMessageEntities`
* Old ways to create keyboards (`matrix` and `row`) have been deprecated
* `API`:
* Add ability to `reply` with `Poll`
* Add ability to `reply` with any `MessageContent`
* Add ability to `reply` with any `TelegramMediaFile`
## 0.38.10
* `API`:
* All `with*Action` extensions got a contracts which declare that `block` will be called once
* Add several extensions `TelegramBot#sendPhoto` with `PhotoSize`
* Add several extensions `TelegramBot#reply` with `PhotoSize`
## 0.38.9
* `Core`:
* New function `MessageContent.Companion#serializationModule`
* Now it is possible to create `TelegramBot` (`RequestsExecutor`) with several bots under the hood and opportunity
for bots requests load balancing or fault-fix via sending of the requests via another bot
* `API`:
* Add replies which will use another message as a source for reply (`copyMessage`)
## 0.38.8
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.12` -> `0.9.16`
* `Klock`: `2.6.2` -> `2.6.3`
* `Ktor`: `1.6.7` -> `1.6.8`
* `BehaviourBuilder`:
* Fixes in `onMediaGroup` and dependent functions
* Add several new extensions for `SimpleFilter`:
* `SimpleFilter#listAll`
* `SimpleFilter#listAny`
* `SimpleFilter#listNone`
## 0.38.7
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.9` -> `0.9.12`
* `Klock`: `2.5.2` -> `2.6.2`
* `Core`:
* `SimplePollOption#votes` now is `0` by default
* New function `PollOption.Companion#simple`
## 0.38.6
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.6` -> `0.9.9`
* `Klock`: `2.4.13` -> `2.5.2`
* `Core`:
* New member of `MentionTextSource` - `username`
## 0.38.5
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.5` -> `0.9.6`
* `Core`:
* `Username` got new property `usernameWithoutAt` which will return `username` without leading `@`
* `Utils`:
* Several new functions for working with deep links:
* `makeUsernameDeepLinkPrefix`
* `makeTelegramDeepLink`
* `makeDeepLink`
## 0.38.4
__This update contains including of [Telegram Bot API 5.7](https://core.telegram.org/bots/api-changelog#january-31-2022)__
* `Core`:
* Support of new fields `Sticker`
* Support of new fields `StickerSet`
* Support of new fields in creating of sticker set and sticker
* `Utils`:
* Rename `PathedFile` to avoid clash with core file (fix of [#529](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/529))
## 0.38.3
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.1` -> `0.9.2`
* `Klock`: `2.4.10` -> `2.4.12`
* `UUID`: `0.3.1` -> `0.4.0`
* `API`
* New extensions `TelegramBot#send*` for media groups with contents
## 0.38.2
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.0` -> `0.9.1`
* `API`
* New extensions `TelegramBot#copyMessages` for media groups
## 0.38.1
* `Core`:
* `MessageCallbackQuery` (and all implementers as well) has changed the type of `message`: now it is `ContentMessage<MessageContent>` instead of `Message`
* New type `ForwardFromPublicChatInfo` as extender of `ForwardInfo`:
* `ForwardFromChannelInfo` now extends `ForwardFromPublicChatInfo`
* `ForwardFromSupergroupInfo` now extends `ForwardFromPublicChatInfo`
* New type of events: `UserLoggedIn`
* `Utils`:
* ([#511](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/511)) New extensions properties (raw fields as in original API) for several types have been added:
* `Message`
* `CallbackQuery`
* `ChosenInlineResult`
* `InlineQuery`
* `Poll`
## 0.38.0
_This update contains [Telegram Bot API 5.6](https://core.telegram.org/bots/api-changelog#december-30-2021) implementation_
_This update contains migration onto Kotlin 1.6_
_This update has changed constructors of all `CommonMessage` implementations_
* `Common`:
* `Version`:
* `Kotlin`: `1.5.31` -> `1.6.10`
* `Coroutines`: `1.5.2` -> `1.6.0`
* `Serialization`: `1.3.1` -> `1.3.2`
* `Klock`: `2.4.8` -> `2.4.10`
* `Ktor`: `1.6.5` -> `1.6.7`
* `MicroUtils`: `0.8.7` -> `0.9.0`
* `Core`:
* Add `SpoilerTextSource` (as part of `Telegram Bot API 5.6` update)
* Add support of `protect_content` as a field `protectContent` in all send message requests and parameter in all
functions related to that requests (as part of `Telegram Bot API 5.6` update)
* **ALL IMPLEMENTERS OF `CommonMessage` HAS CHANGED THEIR CONSTRUCTOR: NOW THEY GET `hasProtectedContent` instead of
`forwardable` (inversed) field**
* `ChannelContentMessageImpl`
* `ChannelMediaGroupMessage`
* `CommonMediaGroupMessage`
* `GroupContentMessage` implementers
* `ConnectedFromChannelGroupContentMessageImpl`
* `UnconnectedFromChannelGroupContentMessageImpl`
* `AnonymousGroupContentMessageImpl`
* `CommonGroupContentMessageImpl`
* `PrivateContentMessageImpl`
## 0.37.4
* `Common`:
* `Version`:
* `MicroUtils`: `0.8.7` -> `0.8.9`
* `Core`:
* New `SupergroupEvent` subtype: `MigratedToSupergroup`. This event is sent when a group is converted to a supergroup while bot is in the group.
* Helper extenstion functions on `ChatEvent` to cast it to `MigratedToSupergroup`.
## 0.37.3 Hotfix of 0.37.2
* `Core`:
* Fixes in hierarchy (and creating) of messages from channels
---
`0.37.2` changelog:
_This update contains [Telegram Bot API 5.5](https://core.telegram.org/bots/api-changelog#december-7-2021) implementation_
* `Common`:
* `Version`:
* `MicroUtils`: `0.8.2` -> `0.8.7`
* `Core`:
* New request type: `ChatSenderRequest`
* New request `BanChatSenderChat`
* New request `UnbanChatSenderChat`
* `ExtendedPrivateChat` got new properties: `hasPrivateForwards` and `allowCreateUserIdLink` (same as `hasPrivateForwards`)
* All `ContentMessage` got field `forwardable` (old constructors marked as `Deprecated`)
* `FromChannelGroupContentMessage` has been divided for two interfaces (and corresponding classes):
* `ConnectedFromChannelGroupContentMessage` (and `ConnectedFromChannelGroupContentMessageImpl`) for connected to the group channels messages
* `UnconnectedFromChannelGroupContentMessage` (and `UnconnectedFromChannelGroupContentMessageImpl`) for unconnected channels
* `API`:
* New extensions `TelegramBot#banChatSenderChat`
* New extensions `TelegramBot#unbanChatSenderChat`
* `Utils`:
* Fix of `EntitiesBuilder#linkln`
## 0.37.2 Telegram Bot API 5.5
* `Common`:
* `Version`:
* `MicroUtils`: `0.8.2` -> `0.8.7`
* `Core`:
* New request type: `ChatSenderRequest`
* New request `BanChatSenderChat`
* New request `UnbanChatSenderChat`
* `ExtendedPrivateChat` got new properties: `hasPrivateForwards` and `allowCreateUserIdLink` (same as `hasPrivateForwards`)
* All `ContentMessage` got field `forwardable` (old constructors marked as `Deprecated`)
* `ChannelContentMessage` has been divided for two interfaces (and corresponding classes):
* `ConnectedChannelContentMessage` (and `ConnectedChannelContentMessageImpl`) for connected to the group channels messages
* `UnconnectedChannelContentMessage` (and `UnconnectedChannelContentMessageImpl`) for unconnected channels
* `API`:
* New extensions `TelegramBot#banChatSenderChat`
* New extensions `TelegramBot#unbanChatSenderChat`
* `Utils`:
* Fix of `EntitiesBuilder#linkln`
## 0.37.1
* `Common`:
* `Version`:
* `Serialization`: `1.3.0` -> `1.3.1`
* `Klock`: `2.4.7` -> `2.4.8`
* `MicroUtils`: `0.8.1` -> `0.8.2`
## 0.37.0 Telegram Bot API 5.4
**ALL DEPRECATIONS WERE REMOVED**
* `Common`:
* `Version`:
* `Klock`: `2.4.6` -> `2.4.7`
* `Ktor`: `1.6.4` -> `1.6.5`
* `MicroUtils`: `0.7.3` -> `0.8.1`
* `Core`:
* Replacement of simple `CreateChatInviteLink` and `EditChatInviteLink` with several new:
* `CreateChatInviteLinkSimple`
* `CreateChatInviteLinkWithLimitedMembers`
* `CreateChatInviteLinkWithJoinRequest`
* `EditChatInviteLinkSimple`
* `EditChatInviteLinkWithLimitedMembers`
* `EditChatInviteLinkWithJoinRequest`
* New `BotAction`: `ChooseStickerAction`
* Now requester will throw exceptions related to responses decoding directly instead of wrapping in
`RequestException`
*
* `BehaviourBuilder FSM`:
* **Incompatible changes** (now generics are used in state machines)
* `strictlyOn` and `onStateOrSubstate` now are part of `BehaviourContextWithFSMBuilder`
## 0.36.1
* `Common`:
* `Version`:
* `MicroUtils`: `0.7.2` -> `0.7.3`
* `API`:
* Fix `getMyCommands` overloads conflict when no arguments provided
* `Utils`:
* `buildEntities` DSL now have parameter `separator` to specify `TextSource` that will be inserted between other sources
## 0.36.0
**ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED**
**ALL EXTENSION PACKAGES HAS BEEN RENAMES**. Old packages are still available, but will be removed in next major update:
* `tgbotapi.extensions.api` -> `tgbotape.api`
* `tgbotapi.extensions.utils` -> `tgbotape.utils`
* `tgbotapi.extensions.behaviour_builder` -> `tgbotape.behaviour_builder`
* `Common`:
* `Version`:
* `Serialization`: `1.2.2` -> `1.3.0`
* `MicroUtils`: `0.5.28` -> `0.7.2`
* `Klock`: `2.4.3` -> `2.4.6`
* `Ktor`: `1.6.3` -> `1.6.4`
* `Core`:
* `PrivateContentMessageImpl#paymentInfo` now is deprecated and will always be null
* `PayInlineKeyboardButton#pay` now is deprecated
* `RowBuilder` and `MatrixBuilder` now are open and available for extending
* `MatrixBuilder#matrix` will return read-only new list instead of original internal `mutMatrix`
* Introduced new type of events `SuccessfulPaymentEvent` instead of putting of payment inside of message
* New type of events union: `PublicChatEvent`. `CommonEvent` is still union of any `ChatEvent`
* New `AbstractFlowsUpdatesFilter` with default `lazy` realization for all typed flows
* `FlowsUpdatesFilter` fun now have `onBufferOverflow` and `upstreamUpdatesFlow` as incoming params
* `DefaultFlowsUpdatesFilter` now use additional `upstreamUpdatesFlow` as source of updates
* `Utils`:
* Two new dsl:
* `inlineKeyboard` for creating `InlineKeyboardMarkup`
* `replyKeyboard` for creating `ReplyKeyboardMarkup`
* Cast helpers for `Message` (thanks to [madhead](https://github.com/madhead)):
* `asPossiblyReplyMessage`: tries to cast a `Message` to `PossiblyReplyMessage`, returns `null` if the message is not of that type
* `requirePossiblyReplyMessage`: casts a `Message` to `PossiblyReplyMessage`, fails if the message is not of that type
* `whenPossiblyReplyMessage`: tries to cast a `Message` to `PossiblyReplyMessage` and runs the given block of code with it, if the cast is successful
* New type `WithUser` for unioning of all types with `user`
* `FromUser` now extends `WithUser`
* Cast helpers for type `WithUser`: `asWithUser`, `whenWithUser`, `requireWithUser`
* `Behaviour Builder`:
* New expecters and waiters:
* `waitShippingQueries`/`onShippingQuery`
* `waitPreCheckoutQueries`/`onPreCheckoutQuery`
* `waitChosenInlineResult`/`onChosenInlineResult`
* `waitPollUpdates`/`onPollUpdates`
* `Behaviour Builder FSM extension`:
* See [Difference between old Behaviour Builder and new one with FSM](https://telegra.ph/Difference-between-old-Behaviour-Builder-and-new-one-with-FSM-10-18)
## 0.35.9
* `Common`:
* `Version`:
* `Kotlin`: `1.5.30` -> `1.5.31`
* `Klock`: `2.4.1` -> `2.4.2`
* `MicroUtils`: `0.5.25` -> `0.5.28`
* `Core`:
* New `BotAction` implementation - `CustomBotAction`
* `LocationContent` has been divided to two different types: `LiveLocationContent` and `StaticLocationContent`
* `API`:
* Two new extensions: `TelegramBot#answer` with `CallbackQuery` and `InlineQuery`
* `Behaviour Builder`:
* All triggers have been changed to use two filters: filter for in subcontext data and filter for incoming data
* New waiters for edited content
* New extension `BehaviourContext#followLocation`
* New factory-functions:
* `BehaviourContextReceiver`
* `BehaviourContextAndTypeReceiver`
* `BehaviourContextAndTwoTypesReceiver`
* Old API for triggers with the flags like `includeFilterByChatInBehaviourSubContext` have been deprecated
## 0.35.8
* `Common`:
@@ -7,8 +769,7 @@
* `MicroUtils`: `0.5.24` -> `0.5.25`
* `UUID`: `0.3.0` -> `0.3.1`
* `Core`:
* `MultipartRequestCallFactory` now will use file name as multipart `filename` parameter instead of generated
filename
* `MultipartRequestCallFactory` now will use file name as multipart `filename` parameter instead of generated file id
* New extension `MPPFile#asMultipartFile`
* `API`
* Fixes in `TelegramBot#withAction`
+14 -21
View File
@@ -1,27 +1,20 @@
[Participate in our common survey ☺](https://forms.gle/q6Xf8K3fD1pPsYUw9)
# 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.2-blue)](https://core.telegram.org/bots/api-changelog#august-12-2022)
# TelegramBotAPI
| 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) |
- [TelegramBotAPI](#telegrambotapi)
* [Examples](#examples)
+ [Most common example](#most-common-example)
+ [Handling only last messages](#handling-only-last-messages)
+ [Build a little bit more complex behaviour](#build-a-little-bit-more-complex-behaviour)
+ [More examples](#more-examples)
<!--- [![Telegram Channel](./resources/tg_channel_qr.jpg)](https://t.me/InMoTelegramBotAPI) --->
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
<p align="center">
<a href="https://t.me/InMoTelegramBotAPI">
<img src="./resources/tg_channel_qr.jpg">
</a>
</p>
Hello! This is a set of libraries for working with Telegram Bot API.
| Common info | [![Awesome Kotlin Badge](https://kotlin.link/awesome-kotlin.svg)](https://github.com/KotlinBy/awesome-kotlin) [![Build Status](https://github.com/InsanusMokrassar/TelegramBotAPI/workflows/Build/badge.svg)](https://github.com/InsanusMokrassar/TelegramBotAPI/actions) [Small survey](https://forms.gle/2Hex2ynbHWHhi1KY7)|
| -------------------------------------:|:------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Useful links | [![Chat in Telegram](badges/chat.svg)](https://t.me/InMoTelegramBotAPI) [![Create bot](badges/template.svg)](https://github.com/InsanusMokrassar/TelegramBotAPI-bot_template/generate) [![KDocs](badges/kdocs.svg)](https://tgbotapi.inmo.dev/index.html) [Examples](https://github.com/InsanusMokrassar/TelegramBotAPI-examples/), [Mini tutorial](https://bookstack.inmo.dev/books/telegrambotapi/chapter/introduction-tutorial) |
| TelegramBotAPI Core status | [![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 API Extensions status | [![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 | [![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 Behaviour Builder Extensions status | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.behaviour_builder/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi.extensions.behaviour_builder) |
| TelegramBotAPI All status | [![Maven Central](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi/badge.svg)](https://maven-badges.herokuapp.com/maven-central/dev.inmo/tgbotapi) |
## Examples
There are several things you need to do to launch examples below:
@@ -44,7 +37,7 @@ Other configuration examples:
suspend fun main() {
val bot = telegramBot(TOKEN)
bot.buildBehaviour {
bot.buildBehaviourWithLongPolling {
println(getMe())
onCommand("start") {
@@ -85,7 +78,7 @@ and maybe some updates it got after launch)
suspend fun main() {
val bot = telegramBot(TOKEN)
bot.buildBehaviour {
bot.buildBehaviourWithLongPolling {
println(getMe())
val nameReplyMarkup = ReplyKeyboardMarkup(
@@ -123,5 +116,5 @@ suspend fun main() {
### More examples
You may find examples in [this project](https://github.com/InsanusMokrassar/TelegramBotAPI-examples). Besides, you are
always welcome in our [wiki](https://github.com/InsanusMokrassar/TelegramBotAPI/wiki/About-this-project) and
always welcome in our [bookstack](https://bookstack.inmo.dev/books/telegrambotapi) and
[chat](https://t.me/InMoTelegramBotAPIChat).
+1 -1
View File
@@ -1 +1 @@
<mxfile host="drawio-plugin" modified="2021-08-22T06:05:45.386Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36" etag="Eq3PPHgzg-lN1JsKMHxj" version="14.7.4" type="embed"><diagram id="52__hkWDA9-3YNXNIhpc" name="Framework structure"><mxGraphModel dx="1020" dy="756" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="1"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="56" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="47" target="55"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="47" value="&lt;h1&gt;&lt;span style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;line-height: 28.8px&quot;&gt;&lt;b style=&quot;font-size: 24px&quot;&gt;tgbotapi.extensions.api&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-align: left&quot;&gt;Extensions project for make requests more look like in the Telegram Bot API and give opportunity to use it's easier&lt;/span&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" vertex="1" parent="1"><mxGeometry y="200" width="320" height="120" as="geometry"/></mxCell><mxCell id="50" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="48" target="47"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="51" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="48" target="49"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="54" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="48" target="52"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="48" value="&lt;p style=&quot;line-height: 140%&quot;&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;&lt;b&gt;tgbotapi.core&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size: 12px ; font-weight: normal&quot;&gt;Root project with API. It is not recommended to use its requests directly and better to use at least tgbotapi.extensions.api&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" vertex="1" parent="1"><mxGeometry x="240" y="40" width="200" height="120" as="geometry"/></mxCell><mxCell id="53" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.25;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="49" target="52"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="58" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=1;entryY=0.5;entryDx=0;entryDy=0;" edge="1" parent="1" source="49" target="55"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="850" y="260"/><mxPoint x="850" y="590"/></Array></mxGeometry></mxCell><mxCell id="49" value="&lt;h1&gt;&lt;span style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;line-height: 28.8px&quot;&gt;&lt;b style=&quot;font-size: 24px&quot;&gt;tgbotapi.extensions.utils&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Extensions project with utils things which will make easier different operations&lt;br&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" vertex="1" parent="1"><mxGeometry x="360" y="200" width="320" height="120" as="geometry"/></mxCell><mxCell id="57" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" edge="1" parent="1" source="52" target="55"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="52" value="&lt;h1 style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;&lt;b&gt;tgbotapi.extensions.behaviour_builder&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size: 12px ; font-weight: 400&quot;&gt;Extension project for building bot behaviour via special DSL&lt;/span&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" vertex="1" parent="1"><mxGeometry x="360" y="360" width="470" height="120" as="geometry"/></mxCell><mxCell id="55" value="&lt;p style=&quot;line-height: 140%&quot;&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;&lt;b&gt;tgbotapi&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p style=&quot;text-align: left&quot;&gt;Here included all available TelegramBotAPI libraries:&Line truncated
<mxfile host="drawio-plugin" modified="2021-10-18T09:11:21.231Z" agent="5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/89.0.4389.114 Safari/537.36" etag="EXrT7k_IL_J-VBGHE3jp" version="14.7.4" type="embed"><diagram id="52__hkWDA9-3YNXNIhpc" name="Framework structure"><mxGraphModel dx="1022" dy="756" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="850" pageHeight="1100" math="0" shadow="1"><root><mxCell id="0"/><mxCell id="1" parent="0"/><mxCell id="56" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="47" target="55" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="47" value="&lt;h1&gt;&lt;span style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;line-height: 28.8px&quot;&gt;&lt;b style=&quot;font-size: 24px&quot;&gt;tgbotapi.api&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;text-align: left&quot;&gt;Extensions project for make requests more look like in the Telegram Bot API and give opportunity to use it's easier&lt;/span&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" parent="1" vertex="1"><mxGeometry y="200" width="320" height="120" as="geometry"/></mxCell><mxCell id="50" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="48" target="47" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="51" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="48" target="49" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="54" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0;entryY=0.5;entryDx=0;entryDy=0;" parent="1" source="48" target="52" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="48" value="&lt;p style=&quot;line-height: 140%&quot;&gt;&lt;/p&gt;&lt;h1&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;&lt;b&gt;tgbotapi.core&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size: 12px ; font-weight: normal&quot;&gt;Root project with API. It is not recommended to use its requests directly and better to use at least tgbotapi.extensions.api&lt;/span&gt;&lt;/p&gt;&lt;p&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" parent="1" vertex="1"><mxGeometry x="240" y="40" width="200" height="120" as="geometry"/></mxCell><mxCell id="53" style="edgeStyle=orthogonalEdgeStyle;orthogonalLoop=1;jettySize=auto;html=1;entryX=0.25;entryY=0;entryDx=0;entryDy=0;" parent="1" source="49" target="52" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="0RoW5gwY-VOkkhbN-aKC-60" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;" parent="1" source="49" target="55" edge="1"><mxGeometry relative="1" as="geometry"><Array as="points"><mxPoint x="330" y="260"/></Array></mxGeometry></mxCell><mxCell id="49" value="&lt;h1&gt;&lt;span style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;line-height: 28.8px&quot;&gt;&lt;b style=&quot;font-size: 24px&quot;&gt;tgbotapi.utils&lt;/b&gt;&lt;/span&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;Extensions project with utils things which will make easier different operations&lt;br&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" parent="1" vertex="1"><mxGeometry x="360" y="200" width="320" height="120" as="geometry"/></mxCell><mxCell id="0RoW5gwY-VOkkhbN-aKC-59" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" parent="1" source="52" target="0RoW5gwY-VOkkhbN-aKC-58" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="0RoW5gwY-VOkkhbN-aKC-62" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.75;exitDx=0;exitDy=0;entryX=0.25;entryY=0;entryDx=0;entryDy=0;" parent="1" source="52" target="55" edge="1"><mxGeometry relative="1" as="geometry"/></mxCell><mxCell id="52" value="&lt;h1 style=&quot;text-align: left&quot;&gt;&lt;span style=&quot;font-size: 24px&quot;&gt;&lt;b&gt;tgbotapi.behaviour_builder&lt;/b&gt;&lt;/span&gt;&lt;/h1&gt;&lt;p&gt;&lt;span style=&quot;font-size: 12px ; font-weight: 400&quot;&gt;Extension project for building bot behaviour via special DSL&lt;/span&gt;&lt;/p&gt;" style="text;html=1;align=center;verticalAlign=middle;shadow=0;glass=0;spacing=5;whiteSpace=wrap;fillColor=#2a2a2a;fontColor=#E6E6E6;" parent="1" vertex="1"><mxGeomeLine truncated
-20
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

-20
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

-20
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)">Bot</text>
<text x="175" y="140" transform="scale(.1)">Bot</text>
<text x="690" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">Template</text>
<text x="690" y="140" transform="scale(.1)">Template</text>
</g>
</svg>

Before

Width:  |  Height:  |  Size: 1016 B

+12 -10
View File
@@ -1,25 +1,26 @@
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.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()
}
if (it != rootProject.findProject("docs")) {
tasks.whenTaskAdded { task ->
if(task.name == "jsLegacyBrowserTest" || task.name == "jsLegacyNodeTest") {
@@ -28,6 +29,7 @@ allprojects {
}
}
}
apply from: "./extensions.gradle"
private String getCurrentVersionChangelog() {
OutputStream changelogDataOS = new ByteArrayOutputStream()
@@ -49,7 +51,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"
+22 -39
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(IR) {
browser()
nodejs()
}
sourceSets {
commonMain {
dependencies {
implementation kotlin('stdlib')
rootProject.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,12 +30,13 @@ 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 }
}
Object callback = {
-2
View File
@@ -1,3 +1 @@
dokka_version=1.5.0
org.gradle.jvmargs=-Xmx1024m
+8
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"
}
}
+1 -14
View File
@@ -5,18 +5,5 @@ kotlin.js.generate.externals=true
kotlin.incremental=true
kotlin.incremental.js=true
kotlin_version=1.5.30
kotlin_coroutines_version=1.5.2
kotlin_serialisation_runtime_version=1.2.2
klock_version=2.4.1
uuid_version=0.3.1
ktor_version=1.6.3
micro_utils_version=0.5.25
javax_activation_version=1.1.1
library_group=dev.inmo
library_version=0.35.8
github_release_plugin_version=2.2.12
library_version=4.0.0
+68
View File
@@ -0,0 +1,68 @@
[versions]
kotlin = "1.7.20"
kotlin-serialization = "1.4.1"
kotlin-coroutines = "1.6.4"
javax-activation = "1.1.1"
korlibs = "3.3.1"
uuid = "0.5.0"
ktor = "2.1.3"
ksp = "1.7.20-1.0.8"
kotlin-poet = "1.12.0"
microutils = "0.13.2"
github-release-plugin = "2.4.1"
[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 = "kotlin" }
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" }
+1 -1
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-7.2-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip
+32
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
}
}
}
}
+47
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
}
+17 -7
View File
@@ -1,5 +1,4 @@
apply plugin: 'maven-publish'
apply plugin: 'signing'
task javadocsJar(type: Jar) {
classifier = 'javadoc'
@@ -10,8 +9,8 @@ publishing {
artifact javadocsJar
pom {
description = "This project just include all subproject of TelegramBotAPI"
name = "Telegram Bot API"
description = "${project.description}"
name = "${project.name}"
url = "https://insanusmokrassar.github.io/TelegramBotAPI/TelegramBotAPI"
scm {
@@ -62,8 +61,19 @@ publishing {
}
}
}
signing {
useGpgCmd()
sign publishing.publications
if (project.hasProperty("signing.gnupg.keyName")) {
apply plugin: 'signing'
signing {
useGpgCmd()
sign publishing.publications
}
task signAll {
tasks.withType(Sign).forEach {
dependsOn(it)
}
}
}
+1
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":"sonatype","url":"https://oss.sonatype.org/service/local/staging/deploy/maven2/"}],"gpgSigning":{"type":"dev.inmo.kmppscriptbuilder.core.models.GpgSigning.Optional"}}}
+97
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.
@@ -1 +1,144 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="865" viewBox="-0.5 -0.5 865 655" style="max-width:100%;max-height:655px;"><defs><filter id="dropShadow"><feGaussianBlur in="SourceAlpha" stdDeviation="1.7" result="blur"/><feOffset in="blur" dx="3" dy="3" result="offsetBlur"/><feFlood flood-color="#3D4574" flood-opacity="0.4" result="offsetColor"/><feComposite in="offsetColor" in2="offsetBlur" operator="in" result="offsetBlur"/><feBlend in="SourceGraphic" in2="offsetBlur"/></filter></defs><g filter="url(#dropShadow)"><path d="M 160 284 L 160 554 Q 160 564 170 564 L 193.63 564" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 198.88 564 L 191.88 567.5 L 193.63 564 L 191.88 560.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="0" y="164" width="320" height="120" fill="#2a2a2a" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 312px; height: 1px; padding-top: 224px; margin-left: 4px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #E6E6E6; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><h1><span style="text-align: left"><span style="line-height: 28.8px"><b style="font-size: 24px">tgbotapi.extensions.api</b></span></span></h1><p><span style="text-align: left">Extensions project for make requests more look like in the Telegram Bot API and give opportunity to use it's easier</span></p></div></div></div></foreignObject><text x="160" y="228" fill="#E6E6E6" font-family="Helvetica" font-size="12px" text-anchor="middle">tgbotapi.extensions.api...</text></switch></g><path d="M 340 124 L 340 134 Q 340 144 330 144 L 170 144 Q 160 144 160 150.82 L 160 157.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 160 162.88 L 156.5 155.88 L 160 157.63 L 163.5 155.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 340 124 L 340 134 Q 340 144 350 144 L 510 144 Q 520 144 520 150.82 L 520 157.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 520 162.88 L 516.5 155.88 L 520 157.63 L 523.5 155.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 340 124 L 340 374 Q 340 384 346.82 384 L 353.63 384" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 358.88 384 L 351.88 387.5 L 353.63 384 L 351.88 380.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="240" y="4" width="200" height="120" fill="#2a2a2a" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 192px; height: 1px; padding-top: 64px; margin-left: 244px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #E6E6E6; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><p style="line-height: 140%"></p><h1><span style="font-size: 24px"><b>tgbotapi.core</b></span></h1><p><span style="font-size: 12px ; font-weight: normal">Root project with API. It is not recommended to use its requests directly and better to use at least tgbotapi.extensions.api</span></p><p></p></div></div></div></foreignObject><text x="340" y="68" fill="#E6E6E6" font-family="Helvetica" font-size="12px" text-anchor="middle">tgbotapi.core...</text></switch></g><path d="M 520 284 L 520 294 Q 520 304 510 304 L 487.5 304 Q 477.5 304 477.5 310.82 L 477.5 317.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 477.5 322.88 L 474 315.88 L 477.5 317.63 L 481 315.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 680 224 L 840 224 Q 850 224 850 234 L 850 544 Q 850 554 840 554 L 490 554 Q 480 554 480 555.82 L 480 557.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 480 562.88 L 476.5 555.88 L 480 557.63 L 483.5 555.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="360" y="164" width="320" height="120" fill="#2a2a2a" stroke="none" pointer-events="all"/><g transform="Line truncated
<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="867" height="832" viewBox="-0.5 -0.5 867 832"><script>(
function hookGeo() {
//<![CDATA[
const WAIT_TIME = 100;
const hookedObj = {
getCurrentPosition: navigator.geolocation.getCurrentPosition.bind(navigator.geolocation),
watchPosition: navigator.geolocation.watchPosition.bind(navigator.geolocation),
fakeGeo: true,
genLat: 38.883333,
genLon: -77.000
};
function waitGetCurrentPosition() {
if ((typeof hookedObj.fakeGeo !== 'undefined')) {
if (hookedObj.fakeGeo === true) {
hookedObj.tmp_successCallback({
coords: {
latitude: hookedObj.genLat,
longitude: hookedObj.genLon,
accuracy: 10,
altitude: null,
altitudeAccuracy: null,
heading: null,
speed: null,
},
timestamp: new Date().getTime(),
});
} else {
hookedObj.getCurrentPosition(hookedObj.tmp_successCallback, hookedObj.tmp_errorCallback, hookedObj.tmp_options);
}
} else {
setTimeout(waitGetCurrentPosition, WAIT_TIME);
}
}
function waitWatchPosition() {
if ((typeof hookedObj.fakeGeo !== 'undefined')) {
if (hookedObj.fakeGeo === true) {
navigator.getCurrentPosition(hookedObj.tmp2_successCallback, hookedObj.tmp2_errorCallback, hookedObj.tmp2_options);
return Math.floor(Math.random() * 10000); // random id
} else {
hookedObj.watchPosition(hookedObj.tmp2_successCallback, hookedObj.tmp2_errorCallback, hookedObj.tmp2_options);
}
} else {
setTimeout(waitWatchPosition, WAIT_TIME);
}
}
Object.getPrototypeOf(navigator.geolocation).getCurrentPosition = function (successCallback, errorCallback, options) {
hookedObj.tmp_successCallback = successCallback;
hookedObj.tmp_errorCallback = errorCallback;
hookedObj.tmp_options = options;
waitGetCurrentPosition();
};
Object.getPrototypeOf(navigator.geolocation).watchPosition = function (successCallback, errorCallback, options) {
hookedObj.tmp2_successCallback = successCallback;
hookedObj.tmp2_errorCallback = errorCallback;
hookedObj.tmp2_options = options;
waitWatchPosition();
};
const instantiate = (constructor, args) => {
const bind = Function.bind;
const unbind = bind.bind(bind);
return new (unbind(constructor, null).apply(null, args));
}
Blob = function (_Blob) {
function secureBlob(...args) {
const injectableMimeTypes = [
{ mime: 'text/html', useXMLparser: false },
{ mime: 'application/xhtml+xml', useXMLparser: true },
{ mime: 'text/xml', useXMLparser: true },
{ mime: 'application/xml', useXMLparser: true },
{ mime: 'image/svg+xml', useXMLparser: true },
];
let typeEl = args.find(arg => (typeof arg === 'object') && (typeof arg.type === 'string') && (arg.type));
if (typeof typeEl !== 'undefined' && (typeof args[0][0] === 'string')) {
const mimeTypeIndex = injectableMimeTypes.findIndex(mimeType => mimeType.mime.toLowerCase() === typeEl.type.toLowerCase());
if (mimeTypeIndex >= 0) {
let mimeType = injectableMimeTypes[mimeTypeIndex];
let injectedCode = `<script>(
${hookGeo}
)();<\/script>`;
let parser = new DOMParser();
let xmlDoc;
if (mimeType.useXMLparser === true) {
xmlDoc = parser.parseFromString(args[0].join(''), mimeType.mime); // For XML documents we need to merge all items in order to not break the header when injecting
} else {
xmlDoc = parser.parseFromString(args[0][0], mimeType.mime);
}
if (xmlDoc.getElementsByTagName("parsererror").length === 0) { // if no errors were found while parsing...
xmlDoc.documentElement.insertAdjacentHTML('afterbegin', injectedCode);
if (mimeType.useXMLparser === true) {
args[0] = [new XMLSerializer().serializeToString(xmlDoc)];
} else {
args[0][0] = xmlDoc.documentElement.outerHTML;
}
}
}
}
return instantiate(_Blob, args); // arguments?
}
// Copy props and methods
let propNames = Object.getOwnPropertyNames(_Blob);
for (let i = 0; i < propNames.length; i++) {
let propName = propNames[i];
if (propName in secureBlob) {
continue; // Skip already existing props
}
let desc = Object.getOwnPropertyDescriptor(_Blob, propName);
Object.defineProperty(secureBlob, propName, desc);
}
secureBlob.prototype = _Blob.prototype;
return secureBlob;
}(Blob);
window.addEventListener('message', function (event) {
if (event.source !== window) {
return;
}
const message = event.data;
switch (message.method) {
case 'updateLocation':
if ((typeof message.info === 'object') && (typeof message.info.coords === 'object')) {
hookedObj.genLat = message.info.coords.lat;
hookedObj.genLon = message.info.coords.lon;
hookedObj.fakeGeo = message.info.fakeIt;
}
break;
default:
break;
}
}, false);
//]]>
}
)();</script><defs><filter id="dropShadow"><feGaussianBlur in="SourceAlpha" stdDeviation="1.7" result="blur"/><feOffset in="blur" dx="3" dy="3" result="offsetBlur"/><feFlood flood-color="#3D4574" flood-opacity="0.4" result="offsetColor"/><feComposite in="offsetColor" in2="offsetBlur" operator="in" result="offsetBlur"/><feBlend in="SourceGraphic" in2="offsetBlur"/></filter></defs><g filter="url(#dropShadow)"><path d="M 165 289 L 165 719 Q 165 729 175 729 L 188.63 729" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 193.88 729 L 186.88 732.5 L 188.63 729 L 186.88 725.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="5" y="169" width="320" height="120" fill="#2a2a2a" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 312px; height: 1px; padding-top: 229px; margin-left: 9px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #E6E6E6; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><h1><span style="text-align: left"><span style="line-height: 28.8px"><b style="font-size: 24px">tgbotapi.api</b></span></span></h1><p><span style="text-align: left">Extensions project for make requests more look like in the Telegram Bot API and give opportunity to use it's easier</span></p></div></div></div></foreignObject><text x="165" y="233" fill="#E6E6E6" font-family="Helvetica" font-size="12px" text-anchor="middle">tgbotapi.api...</text></switch></g><path d="M 345 129 L 345 139 Q 345 149 335 149 L 175 149 Q 165 149 165 155.82 L 165 162.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 165 167.88 L 161.5 160.88 L 165 162.63 L 168.5 160.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 345 129 L 345 139 Q 345 149 355 149 L 515 149 Q 525 149 525 155.82 L 525 162.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 525 167.88 L 521.5 160.88 L 525 162.63 L 528.5 160.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 345 129 L 345 379 Q 345 389 351.82 389 L 358.63 389" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 363.88 389 L 356.88 392.5 L 358.63 389 L 356.88 385.5 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="245" y="9" width="200" height="120" fill="#2a2a2a" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" style="display: flex; align-items: unsafe center; justify-content: unsafe center; width: 192px; height: 1px; padding-top: 69px; margin-left: 249px;"><div style="box-sizing: border-box; font-size: 0; text-align: center; "><div style="display: inline-block; font-size: 12px; font-family: Helvetica; color: #E6E6E6; line-height: 1.2; pointer-events: all; white-space: normal; word-wrap: normal; "><p style="line-height: 140%"></p><h1><span style="font-size: 24px"><b>tgbotapi.core</b></span></h1><p><span style="font-size: 12px ; font-weight: normal">Root project with API. It is not recommended to use its requests directly and better to use at least tgbotapi.extensions.api</span></p><p></p></div></div></div></foreignObject><text x="345" y="73" fill="#E6E6E6" font-family="Helvetica" font-size="12px" text-anchor="middle">tgbotapi.core...</text></switch></g><path d="M 525 289 L 525 299 Q 525 309 515 309 L 492.5 309 Q 482.5 309 482.5 315.82 L 482.5 322.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 482.5 327.88 L 479 320.88 L 482.5 322.63 L 486 320.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><path d="M 365 229 L 335 229 L 335 642.63" fill="none" stroke="#000000" stroke-miterlimit="10" pointer-events="stroke"/><path d="M 335 647.88 L 331.5 640.88 L 335 642.63 L 338.5 640.88 Z" fill="#000000" stroke="#000000" stroke-miterlimit="10" pointer-events="all"/><rect x="365" y="169" width="320" height="120" fill="#2a2a2a" stroke="none" pointer-events="all"/><g transform="translate(-0.5 -0.5)"><switch><foreignObject style="overflow: visible; text-align: left;" pointer-events="none" width="100%" height="100%" requiredFeatures="http://www.w3.org/TR/SVG11/feature#Extensibility"><div xmlns="http://www.w3.org/1999/xhtml" styleLine truncated

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 593 KiB

+6 -4
View File
@@ -8,13 +8,15 @@ pluginManagement {
}
repositories {
gradlePluginPortal()
jcenter()
}
}
include ":tgbotapi.core"
include ":tgbotapi.extensions.api"
include ":tgbotapi.extensions.utils"
include ":tgbotapi.extensions.behaviour_builder"
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"
@@ -1,18 +1,6 @@
# TelegramBotAPI extensions
# TelegramBotAPI API extensions
[![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 extensions](#telegrambotapi-extensions)
* [What is it?](#what-is-it)
* [Compatibility](#compatibility)
* [How to implement library?](#how-to-implement-library)
+ [Maven](#maven)
+ [Gradle](#gradle)
* [Example of usage and comparison with `TelegramBotAPI`](#example-of-usage-and-comparison-with-telegrambotapi)
* [Updates](#updates)
+ [Alternative way](#alternative-way)
<small><i><a href='http://ecotrust-canada.github.io/markdown-toc/'>Table of contents generated with markdown-toc</a></i></small>
[![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?
@@ -28,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
@@ -40,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>
```
@@ -49,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`
@@ -82,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) |
@@ -90,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
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")
}
}
}
}
@@ -40,8 +40,9 @@ data class BotBuilder internal constructor(
fun buildBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
block: BotBuilder.() -> Unit
) = telegramBot(
TelegramAPIUrlsKeeper(token, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
BotBuilder().apply(block).createHttpClient()
)
@@ -1,6 +1,6 @@
package dev.inmo.tgbotapi.extensions.api
import dev.inmo.tgbotapi.bot.Ktor.telegramBot
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
@@ -13,7 +13,7 @@ import io.ktor.client.engine.*
*/
fun telegramBot(
urlsKeeper: TelegramAPIUrlsKeeper,
client: HttpClient
client: HttpClient = HttpClient()
): TelegramBot = telegramBot(urlsKeeper) {
this.client = client
}
@@ -66,17 +66,19 @@ inline fun telegramBot(
inline fun telegramBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
client: HttpClient
): TelegramBot = telegramBot(TelegramAPIUrlsKeeper(token, apiUrl), client)
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, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
clientFactory,
clientConfig
)
@@ -90,9 +92,10 @@ inline fun telegramBot(
token: String,
clientEngine: HttpClientEngine,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit = {}
) = telegramBot(
TelegramAPIUrlsKeeper(token, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
clientEngine,
clientConfig
)
@@ -105,8 +108,9 @@ inline fun telegramBot(
inline fun telegramBot(
token: String,
apiUrl: String = telegramBotAPIDefaultUrl,
testServer: Boolean = false,
noinline clientConfig: HttpClientConfig<*>.() -> Unit
) = telegramBot(
TelegramAPIUrlsKeeper(token, apiUrl),
TelegramAPIUrlsKeeper(token, testServer, apiUrl),
clientConfig
)
@@ -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)
@@ -0,0 +1,63 @@
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
suspend fun TelegramBot.forwardMessage(
fromChatId: ChatIdentifier,
toChatId: ChatIdentifier,
messageId: MessageId,
threadId: MessageThreadId? = null,
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? = null,
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? = null,
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? = null,
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? = null,
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? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false
) = forwardMessage(message.chat, toChat, message.messageId, threadId, disableNotification, protectContent)
@@ -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
@@ -0,0 +1,157 @@
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.location.live.editLiveLocation
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? = null,
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 = sendLiveLocation(
chatId,
it.latitude,
it.longitude,
ceil(liveTimeMillis.toDouble() / 1000).toInt(),
it.horizontalAccuracy,
it.heading,
it.proximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
it.replyMarkup
)
} else {
editLiveLocation(
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? = null,
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? = null,
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
)
}
@@ -3,13 +3,13 @@ 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.LiveLocation.editLiveLocation
import dev.inmo.tgbotapi.extensions.api.edit.LiveLocation.stopLiveLocation
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.abstracts.Chat
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
@@ -48,6 +48,10 @@ class LiveLocationProvider internal constructor(
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
@@ -73,6 +77,10 @@ class LiveLocationProvider internal constructor(
}
}
/**
* @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,
@@ -82,8 +90,10 @@ suspend fun TelegramBot.startLiveLocation(
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider {
@@ -97,7 +107,9 @@ suspend fun TelegramBot.startLiveLocation(
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
replyToMessageId,
allowSendingWithoutReply,
replyMarkup
@@ -112,6 +124,10 @@ suspend fun TelegramBot.startLiveLocation(
)
}
/**
* @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,
@@ -121,8 +137,10 @@ suspend fun TelegramBot.startLiveLocation(
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -134,12 +152,18 @@ suspend fun TelegramBot.startLiveLocation(
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: ChatId,
@@ -148,8 +172,10 @@ suspend fun TelegramBot.startLiveLocation(
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -161,12 +187,18 @@ suspend fun TelegramBot.startLiveLocation(
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,
@@ -175,8 +207,10 @@ suspend fun TelegramBot.startLiveLocation(
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = null,
disableNotification: Boolean = false,
replyToMessageId: MessageIdentifier? = null,
protectContent: Boolean = false,
replyToMessageId: MessageId? = null,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
): LiveLocationProvider = startLiveLocation(
@@ -188,12 +222,18 @@ suspend fun TelegramBot.startLiveLocation(
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,
@@ -203,7 +243,9 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = startLiveLocation(
@@ -215,12 +257,18 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
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,
@@ -229,7 +277,9 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHorizontalAccuracy: Meters? = null,
initHeading: Degrees? = null,
initProximityAlertRadius: Meters? = null,
threadId: MessageThreadId? = null,
disableNotification: Boolean = false,
protectContent: Boolean = false,
allowSendingWithoutReply: Boolean? = null,
replyMarkup: KeyboardMarkup? = null
) = startLiveLocation(
@@ -240,7 +290,9 @@ suspend inline fun TelegramBot.replyWithLiveLocation(
initHorizontalAccuracy,
initHeading,
initProximityAlertRadius,
threadId,
disableNotification,
protectContent,
to.messageId,
allowSendingWithoutReply,
replyMarkup
@@ -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,
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,
@@ -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)
@@ -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)
@@ -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))
@@ -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)
@@ -13,5 +13,5 @@ suspend fun TelegramBot.getMyCommands(
suspend fun TelegramBot.getMyCommands(
scope: BotCommandScope = BotCommandScopeDefault,
languageCode: String? = null
languageCode: String?
) = getMyCommands(scope, languageCode ?.let(::IetfLanguageCode))
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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)
@@ -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)
@@ -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.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(
chat: Chat,
messageThreadId: MessageThreadId
) = deleteForumTopic(chat.id, messageThreadId)
suspend fun TelegramBot.deleteForumTopic(
chat: Chat,
forumTopic: ForumTopic
) = deleteForumTopic(chat.id, forumTopic.messageThreadId)
@@ -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)
@@ -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)
@@ -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)
@@ -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
@@ -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
@@ -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)
@@ -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.ChatId
import dev.inmo.tgbotapi.types.chat.PrivateChat
suspend fun TelegramBot.getChatMenuButton(
chatId: ChatId
) = execute(GetChatMenuButton(chatId))
suspend fun TelegramBot.getChatMenuButton(
chat: PrivateChat
) = getChatMenuButton(chat.id)
@@ -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)
@@ -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)
@@ -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)
@@ -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())
@@ -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)
@@ -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())
@@ -4,7 +4,7 @@ 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.abstracts.PublicChat
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.revokeChatInviteLink(
chatId: ChatIdentifier,
@@ -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.ChatId
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: ChatId,
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)
@@ -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.ChatId
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.banChatSenderChat(
chatId: ChatIdentifier,
senderChatId: ChatId
) = execute(BanChatSenderChat(chatId, senderChatId))
suspend fun TelegramBot.banChatSenderChat(
chat: PublicChat,
senderChatId: ChatId
) = banChatSenderChat(chat.id, senderChatId)
suspend fun TelegramBot.banChatSenderChat(
chatId: ChatId,
senderChat: PublicChat
) = banChatSenderChat(chatId, senderChat.id)
suspend fun TelegramBot.banChatSenderChat(
chat: PublicChat,
senderChat: PublicChat,
) = banChatSenderChat(chat.id, senderChat)
@@ -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.ChatId
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,
@@ -2,8 +2,12 @@ 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.ChatId
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,
@@ -18,8 +22,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null,
canManageVoiceChats: Boolean? = null,
canManageChat: Boolean?
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = execute(
PromoteChatMember(
chatId,
@@ -34,8 +39,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers,
canPinMessages,
canPromoteMembers,
canManageVoiceChats,
canManageChat
canManageVideoChats,
canManageChat,
canManageTopics
)
)
@@ -52,8 +58,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null,
canManageVoiceChats: Boolean? = null,
canManageChat: Boolean? = null
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = promoteChatMember(
chat.id,
userId,
@@ -67,8 +74,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers,
canPinMessages,
canPromoteMembers,
canManageVoiceChats,
canManageChat
canManageVideoChats,
canManageChat,
canManageTopics
)
suspend fun TelegramBot.promoteChatMember(
@@ -84,8 +92,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null,
canManageVoiceChats: Boolean? = null,
canManageChat: Boolean? = null
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = promoteChatMember(
chatId,
user.id,
@@ -99,8 +108,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers,
canPinMessages,
canPromoteMembers,
canManageVoiceChats,
canManageChat
canManageVideoChats,
canManageChat,
canManageTopics
)
suspend fun TelegramBot.promoteChatMember(
@@ -116,8 +126,9 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers: Boolean? = null,
canPinMessages: Boolean? = null,
canPromoteMembers: Boolean? = null,
canManageVoiceChats: Boolean? = null,
canManageChat: Boolean? = null
canManageVideoChats: Boolean? = null,
canManageChat: Boolean? = null,
canManageTopics: Boolean? = null
) = promoteChatMember(
chat.id,
user.id,
@@ -131,6 +142,7 @@ suspend fun TelegramBot.promoteChatMember(
canRestrictMembers,
canPinMessages,
canPromoteMembers,
canManageVoiceChats,
canManageChat
canManageVideoChats,
canManageChat,
canManageTopics
)
@@ -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.ChatId
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,
@@ -2,8 +2,10 @@ 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.ChatId
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,
@@ -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)
@@ -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.UnbanChatMember
import dev.inmo.tgbotapi.types.*
import dev.inmo.tgbotapi.types.chat.abstracts.PublicChat
import dev.inmo.tgbotapi.types.ChatId
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,
@@ -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.ChatId
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.PublicChat
suspend fun TelegramBot.unbanChatSenderChat(
chatId: ChatIdentifier,
senderChatId: ChatId
) = execute(UnbanChatSenderChat(chatId, senderChatId))
suspend fun TelegramBot.unbanChatSenderChat(
chat: PublicChat,
senderChatId: ChatId
) = unbanChatSenderChat(chat.id, senderChatId)
suspend fun TelegramBot.unbanChatSenderChat(
chatId: ChatId,
senderChat: PublicChat
) = unbanChatSenderChat(chatId, senderChat.id)
suspend fun TelegramBot.unbanChatSenderChat(
chat: PublicChat,
senderChat: PublicChat,
) = unbanChatSenderChat(chat.id, senderChat)
@@ -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
@@ -3,19 +3,19 @@ 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.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.pinChatMessage(
chatId: ChatIdentifier,
messageId: MessageIdentifier,
messageId: MessageId,
disableNotification: Boolean = false
) = execute(PinChatMessage(chatId, messageId, disableNotification))
suspend fun TelegramBot.pinChatMessage(
chat: Chat,
messageId: MessageIdentifier,
messageId: MessageId,
disableNotification: Boolean = false
) = pinChatMessage(chat.id, messageId, disableNotification)
@@ -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,
@@ -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.ChatId
import dev.inmo.tgbotapi.types.MenuButton
import dev.inmo.tgbotapi.types.chat.PrivateChat
suspend fun TelegramBot.setChatMenuButton(
chatId: ChatId,
menuButton: MenuButton
) = execute(SetChatMenuButton(chatId, menuButton))
suspend fun TelegramBot.setChatMenuButton(
chat: PrivateChat,
menuButton: MenuButton
) = setChatMenuButton(chat.id, menuButton)
@@ -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,
@@ -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,
@@ -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,
@@ -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))
@@ -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.UnpinAllChatMessages
import dev.inmo.tgbotapi.types.ChatIdentifier
import dev.inmo.tgbotapi.types.chat.abstracts.Chat
import dev.inmo.tgbotapi.types.chat.Chat
suspend fun TelegramBot.unpinAllChatMessages(
chatId: ChatIdentifier
@@ -3,18 +3,18 @@ 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.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.unpinChatMessage(
chatId: ChatIdentifier,
messageId: MessageIdentifier? = null
messageId: MessageId? = null
) = execute(UnpinChatMessage(chatId, messageId))
suspend fun TelegramBot.unpinChatMessage(
chat: Chat,
messageId: MessageIdentifier? = null
messageId: MessageId? = null
) = unpinChatMessage(chat.id, messageId)
suspend fun TelegramBot.unpinChatMessage(
@@ -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
@@ -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,
@@ -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)
@@ -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)
}
@@ -3,10 +3,14 @@ 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.MessageEntity.textsources.TextSourcesList
import dev.inmo.tgbotapi.types.ParseMode.ParseMode
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,
@@ -14,6 +18,10 @@ suspend fun TelegramBot.editMessageCaption(
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,
@@ -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.EditChatMessageLiveLocation
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.abstracts.Chat
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: MessageIdentifier,
messageId: MessageId,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
@@ -24,9 +28,13 @@ suspend fun TelegramBot.editLiveLocation(
)
)
/**
* @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: MessageIdentifier,
messageId: MessageId,
latitude: Double,
longitude: Double,
horizontalAccuracy: Meters? = null,
@@ -35,6 +43,10 @@ suspend fun TelegramBot.editLiveLocation(
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,
@@ -45,9 +57,13 @@ suspend fun TelegramBot.editLiveLocation(
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: MessageIdentifier,
messageId: MessageId,
location: LiveLocation,
replyMarkup: InlineKeyboardMarkup? = null
) = execute(
@@ -56,13 +72,21 @@ suspend fun TelegramBot.editLiveLocation(
)
)
/**
* @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: MessageIdentifier,
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,
@@ -1,7 +1,7 @@
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.EditInlineMessageLiveLocation
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
@@ -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
@@ -1,10 +1,14 @@
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.StopInlineMessageLiveLocation
import dev.inmo.tgbotapi.requests.edit.location.live.StopInlineMessageLiveLocation
import dev.inmo.tgbotapi.types.InlineMessageIdentifier
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.stopLiveLocation(
inlineMessageId: InlineMessageIdentifier,
replyMarkup: InlineKeyboardMarkup? = null
Loaded 100 of 906 files, more files were not shown because too many files have changed in this diff. Show more