feat(tg): add InvokeJSON method for MTProto JSON format#1645
Merged
feat(tg): add InvokeJSON method for MTProto JSON format#1645
Conversation
Add InvokeJSON method to tg.Client that accepts MTProto JSON format (e.g., messages.sendMessage) and returns JSON response. Features: - Accepts JSON with @type field in MTProto format (namespace.methodName) - Supports snake_case or PascalCase output via useSnakeCase parameter - Uses jx for input parsing (no reflection overhead) - Uses generated constructors and type maps (no reflection) - Handles nested objects with @type fields - Supports Int128/Int256 hex string detection Also update README.md to document MTProto JSON format usage instead of TDLib format, showing proper usage with client.API().InvokeJSON().
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1645 +/- ##
==========================================
- Coverage 70.69% 68.77% -1.93%
==========================================
Files 443 445 +2
Lines 17950 18393 +443
==========================================
- Hits 12690 12650 -40
- Misses 4317 4797 +480
- Partials 943 946 +3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add InvokeJSON method to tg.Client that accepts MTProto JSON format (e.g., messages.sendMessage) and returns JSON response.
Features:
Also update README.md to document MTProto JSON format usage instead of TDLib format, showing proper usage with client.API().InvokeJSON().