From c0ec4cbcb7fa0e1ed557e52ab8b5781efc34d4a9 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Tue, 25 Jun 2024 22:57:48 +0530 Subject: [PATCH 1/5] =?UTF-8?q?=E2=9C=8D=EF=B8=8F=20Fix=20README?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 20cae781..1470ca4b 100644 --- a/README.md +++ b/README.md @@ -439,6 +439,3 @@ clean, maintainable code that responds to messages and updates on Telegram. So, what are you waiting for? Start building your Telegram bot with Televerse today! [![Buy Me a Coffee](https://img.shields.io/badge/Buy%20Me%20a%20Coffee-Say%20Thanks-blue?style=flat-square&logo=buy-me-a-coffee)](https://www.buymeacoffee.com/heysreelal) - -``` -``` From fd3b8729f6f70eb053070227d973fb9cad809e9f Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Wed, 26 Jun 2024 10:00:54 +0530 Subject: [PATCH 2/5] =?UTF-8?q?=F0=9F=A9=BA=20Fixes=20a=20minor=20document?= =?UTF-8?q?ation=20issue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/televerse/models/payload.dart | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/src/televerse/models/payload.dart b/lib/src/televerse/models/payload.dart index 5bf65def..9a25fd7b 100644 --- a/lib/src/televerse/models/payload.dart +++ b/lib/src/televerse/models/payload.dart @@ -55,7 +55,7 @@ class Payload { Payload({Map? params, this.files}) : params = params ?? {}; /// Creates a new `Payload` instance from an existing map of parameters and a list of multipart files. - + /// /// This factory constructor is useful when you already have the data for the /// payload in separate variables and want to create a new `Payload` object /// without the need to construct a new map or list. From ca3bb1d60707ca9930ff9991de520cf573ce4c28 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Wed, 26 Jun 2024 12:01:46 +0530 Subject: [PATCH 3/5] =?UTF-8?q?=F0=9F=AB=A5=20Simplfied=20the=20`Payload`?= =?UTF-8?q?=20constructor?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/televerse/models/payload.dart | 6 +- lib/src/televerse/raw_api.dart | 455 +++++++------------------- 2 files changed, 115 insertions(+), 346 deletions(-) diff --git a/lib/src/televerse/models/payload.dart b/lib/src/televerse/models/payload.dart index 9a25fd7b..67f59b97 100644 --- a/lib/src/televerse/models/payload.dart +++ b/lib/src/televerse/models/payload.dart @@ -52,7 +52,7 @@ class Payload { /// Each map associates a field key (a `String`) with its corresponding /// `MultipartFile` object. This type is typically used to represent a collection /// of files to be uploaded in a multipart request. (See [Payload.files] for details) - Payload({Map? params, this.files}) : params = params ?? {}; + Payload([Map? params, this.files]) : params = params ?? {}; /// Creates a new `Payload` instance from an existing map of parameters and a list of multipart files. /// @@ -72,8 +72,8 @@ class Payload { /// A new `Payload` object with the provided parameters and files. factory Payload.from([Map? params, PayloadFiles? files]) => Payload( - params: params, - files: files, + params, + files, ); /// Get the parameter value for the key diff --git a/lib/src/televerse/raw_api.dart b/lib/src/televerse/raw_api.dart index fab41cc5..bb7a6022 100644 --- a/lib/src/televerse/raw_api.dart +++ b/lib/src/televerse/raw_api.dart @@ -718,10 +718,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendDocument, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return Message.fromJson(response); } @@ -777,10 +774,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendVideo, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return Message.fromJson(response); } @@ -834,10 +828,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendAnimation, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return Message.fromJson(response); } @@ -880,10 +871,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendVoice, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return Message.fromJson(response); @@ -927,10 +915,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendVideoNote, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return Message.fromJson(response); } @@ -998,10 +983,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.sendMediaGroup, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return (response).map((e) => Message.fromJson(e)).toList(); @@ -1042,9 +1024,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.sendLocation, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); } @@ -1078,9 +1058,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.editMessageLiveLocation, - payload: Payload( - params: params, - ), + payload: Payload(params), ); if (MessageOrBool == _Ignore) { @@ -1173,9 +1151,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.stopMessageLiveLocation, - payload: Payload( - params: params, - ), + payload: Payload(params), ); if (MessageOrBool == _Ignore) { @@ -1265,9 +1241,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.sendVenue, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); } @@ -1303,9 +1277,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.sendContact, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); } @@ -1415,9 +1387,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.sendPoll, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); } @@ -1456,9 +1426,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.sendDice, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); } @@ -1488,9 +1456,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.sendChatAction, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1508,9 +1474,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getUserProfilePhotos, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return UserProfilePhotos.fromJson(response); } @@ -1524,9 +1488,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getFile, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return File.fromJson(response); } @@ -1546,9 +1508,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.banChatMember, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1566,9 +1526,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.unbanChatMember, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1593,9 +1551,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.restrictChatMember, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1638,9 +1594,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.promoteChatMember, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1658,9 +1612,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setChatAdministratorCustomTitle, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1676,9 +1628,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.banChatSenderChat, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1694,9 +1644,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.unbanChatSenderChat, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1717,9 +1665,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setChatPermissions, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1735,9 +1681,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.exportChatInviteLink, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1785,9 +1729,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.createChatInviteLink, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ChatInviteLink.fromJson(response); } @@ -1837,9 +1779,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.editChatInviteLink, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ChatInviteLink.fromJson(response); } @@ -1855,9 +1795,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.revokeChatInviteLink, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ChatInviteLink.fromJson(response); } @@ -1873,9 +1811,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.approveChatJoinRequest, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1891,9 +1827,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.declineChatJoinRequest, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1912,10 +1846,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setChatPhoto, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return response; } @@ -1929,9 +1860,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.deleteChatPhoto, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1955,9 +1884,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setChatTitle, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -1982,9 +1909,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setChatDescription, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2002,9 +1927,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.pinChatMessage, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2020,9 +1943,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.unpinChatMessage, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2036,9 +1957,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.unpinAllChatMessages, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2052,9 +1971,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.leaveChat, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2068,9 +1985,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getChat, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ChatFullInfo.fromJson(response); } @@ -2084,9 +1999,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.getChatAdministrators, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response.map((e) => ChatMember.fromJson(e)).toList(); } @@ -2100,9 +2013,7 @@ class RawAPI { }; int response = await _makeApiCall( APIMethod.getChatMembersCount, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2118,9 +2029,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getChatMember, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ChatMember.fromJson(response); } @@ -2136,9 +2045,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setChatStickerSet, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2152,9 +2059,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.deleteChatStickerSet, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2194,9 +2099,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.createForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ForumTopic.fromJson(response); } @@ -2224,9 +2127,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.editForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2242,9 +2143,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.closeForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2260,9 +2159,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.reopenForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2278,9 +2175,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.deleteForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2296,9 +2191,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.unpinAllForumTopicMessages, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2322,9 +2215,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.editGeneralForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2338,9 +2229,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.closeGeneralForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2354,9 +2243,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.reopenGeneralForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2370,9 +2257,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.hideGeneralForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2386,9 +2271,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.unhideGeneralForumTopic, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2410,9 +2293,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.answerCallbackQuery, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2430,9 +2311,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setMyCommands, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2448,9 +2327,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.deleteMyCommands, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2466,9 +2343,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.getMyCommands, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response.map((e) => BotCommand.fromJson(e)).toList(); } @@ -2484,9 +2359,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setChatMenuButton, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2500,9 +2373,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getChatMenuButton, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return MenuButton.create(response); } @@ -2518,9 +2389,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setMyDefaultAdministratorRights, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -2534,9 +2403,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getMyDefaultAdministratorRights, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return ChatAdministratorRights.fromJson(response); } @@ -2567,9 +2434,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.editMessageText, - payload: Payload( - params: params, - ), + payload: Payload(params), ); if (MessageOrBool == _Ignore) { @@ -2663,9 +2528,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.editMessageCaption, - payload: Payload( - params: params, - ), + payload: Payload(params), ); if (MessageOrBool == _Ignore) { @@ -2762,10 +2625,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.editMessageMedia, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); if (MessageOrBool == _Ignore) { @@ -2840,9 +2700,7 @@ class RawAPI { }; final response = await _makeApiCall( APIMethod.editMessageReplyMarkup, - payload: Payload( - params: params, - ), + payload: Payload(params), ); if (MessageOrBool == _Ignore) { @@ -2913,9 +2771,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.stopPoll, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Poll.fromJson(response); } @@ -2941,7 +2797,7 @@ class RawAPI { }; final response = _makeApiBoolCall( APIMethod.deleteMessage, - payload: Payload(params: params), + payload: Payload(params), ); return response; } @@ -2982,10 +2838,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendSticker, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return Message.fromJson(response); @@ -3000,9 +2853,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getStickerSet, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return StickerSet.fromJson(response); } @@ -3016,9 +2867,7 @@ class RawAPI { }; List response = await _makeApiCall( APIMethod.getCustomEmojiStickers, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response.map((e) => Sticker.fromJson(e)).toList(); } @@ -3043,8 +2892,8 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.uploadStickerFile, payload: Payload( - files: files, - params: params, + params, + files, ), ); return File.fromJson(response); @@ -3077,10 +2926,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.addStickerToSet, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return response; @@ -3097,9 +2943,7 @@ class RawAPI { }; final response = await _makeApiBoolCall( APIMethod.setStickerPositionInSet, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -3112,9 +2956,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.deleteStickerFromSet, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3144,10 +2986,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setStickerSetThumbnail, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return response; @@ -3176,9 +3015,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.answerInlineQuery, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3196,9 +3033,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.answerWebAppQuery, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return SentWebAppMessage.fromJson(response); } @@ -3286,9 +3121,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendInvoice, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); @@ -3359,9 +3192,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.createInvoiceLink, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3405,9 +3236,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.answerShippingQuery, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3440,9 +3269,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.answerPreCheckoutQuery, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3461,9 +3288,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setPassportDataErrors, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -3494,9 +3319,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.sendGame, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); @@ -3527,9 +3350,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.setGameScore, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return Message.fromJson(response); @@ -3559,9 +3380,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setInlineGameScore, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3593,9 +3412,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.getGameHighScores, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response.map((e) => GameHighScore.fromJson(e)).toList(); @@ -3617,9 +3434,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setMyDescription, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3635,9 +3450,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.getMyDescription, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return BotDescription.fromJson(response); @@ -3655,9 +3468,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setMyShortDescription, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3673,9 +3484,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.getMyShortDescription, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return BotShortDescription.fromJson(response); @@ -3719,10 +3528,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.createNewStickerSet, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return response; @@ -3744,9 +3550,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setCustomEmojiStickerSetThumbnail, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3768,9 +3572,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setStickerSetTitle, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3789,9 +3591,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.deleteStickerSet, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3813,9 +3613,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setStickerEmojiList, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3837,9 +3635,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setStickerKeywords, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3861,9 +3657,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setStickerMaskPosition, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3883,9 +3677,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setMyName, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -3900,9 +3692,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.getMyName, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return BotName.fromJson(response); @@ -3918,9 +3708,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.unpinAllGeneralForumTopicMessages, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3944,9 +3732,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.setMessageReaction, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -3967,9 +3753,7 @@ class RawAPI { final response = await _makeApiBoolCall( APIMethod.deleteMessages, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; @@ -4002,9 +3786,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.forwardMessages, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response.map((e) => MessageId.fromJson(e)).toList(); @@ -4042,9 +3824,7 @@ class RawAPI { final response = await _makeApiCall( APIMethod.copyMessages, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response.map((e) => MessageId.fromJson(e)).toList(); @@ -4065,9 +3845,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.getUserChatBoosts, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return UserChatBoosts.fromJson(response); @@ -4082,9 +3860,7 @@ class RawAPI { }; final response = await _makeApiJsonCall( APIMethod.getBusinessConnection, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return BusinessConnection.fromJson(response); @@ -4113,10 +3889,7 @@ class RawAPI { final response = _makeApiBoolCall( APIMethod.replaceStickerInSet, - payload: Payload( - params: params, - files: files, - ), + payload: Payload(params, files), ); return response; @@ -4140,9 +3913,7 @@ class RawAPI { final response = _makeApiBoolCall( APIMethod.refundStarPayment, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return response; } @@ -4162,9 +3933,7 @@ class RawAPI { final response = await _makeApiJsonCall( APIMethod.getStarTransactions, - payload: Payload( - params: params, - ), + payload: Payload(params), ); return StarTransactions.fromJson(response); From 5bdf6edda1031f528096ddbd18d778c7ffd66812 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Wed, 26 Jun 2024 12:06:04 +0530 Subject: [PATCH 4/5] =?UTF-8?q?=F0=9F=AB=A1=20Fix=20documentation=20commen?= =?UTF-8?q?ts?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/src/televerse/models/payload.dart | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/src/televerse/models/payload.dart b/lib/src/televerse/models/payload.dart index 67f59b97..e0768c38 100644 --- a/lib/src/televerse/models/payload.dart +++ b/lib/src/televerse/models/payload.dart @@ -11,6 +11,7 @@ typedef PayloadFiles = List>; /// /// This class encapsulates the data to be sent to an API endpoint. It can /// contain both standard parameters and multipart files for upload. +/// /// Properties: /// /// * [params]: An optional map containing additional parameters for the API call. From cbe4696c6c8cafbee136cd5ccc84d27ff7c464e0 Mon Sep 17 00:00:00 2001 From: Sreelal TS Date: Wed, 26 Jun 2024 12:06:50 +0530 Subject: [PATCH 5/5] =?UTF-8?q?=E2=9C=A8=20Version=20and=20changelog=20upd?= =?UTF-8?q?ate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 5 +++++ pubspec.yaml | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index e7c5fe43..60e643f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,8 @@ +# 1.19.4 + +- Minor README fix +- Fixes in documentation comments + # 1.19.3 - Changed return type of the `Transformer.transform` from diff --git a/pubspec.yaml b/pubspec.yaml index aa56c8bf..e40a7bc5 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: televerse description: Televerse lets you create your own efficient Telegram bots with ease in Dart. Supports latest Telegram Bot API - 7.5! -version: 1.19.3 +version: 1.19.4 homepage: https://github.com/HeySreelal/televerse topics: - telegram