Skip to content

Conversation

@majiayu000
Copy link
Contributor

Fixes #1332

Changes

  • Add telegram/takeout package with Client wrapper that implements tg.Invoker
  • Client.Invoke automatically wraps calls with InvokeWithTakeoutRequest
  • Add Run function to manage takeout session lifecycle (init, callback, cleanup)
  • Add Config struct for configuring takeout session options (contacts, messages, files, etc.)

Add telegram/takeout package that provides a convenient wrapper around
Telegram's takeout API. The wrapper:

- Manages takeout session lifecycle (init/finish)
- Wraps all API calls with invokeWithTakeout automatically
- Provides Config struct for configuring export options
- Properly marks session as success/failure based on callback result

Closes gotd#1332

Signed-off-by: majiayu000 <1835304752@qq.com>
@codecov
Copy link

codecov bot commented Jan 6, 2026

Codecov Report

❌ Patch coverage is 89.74359% with 4 lines in your changes missing coverage. Please review.
✅ Project coverage is 68.86%. Comparing base (0535561) to head (6c50a9f).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
telegram/takeout/takeout.go 89.74% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1660      +/-   ##
==========================================
- Coverage   69.02%   68.86%   -0.16%     
==========================================
  Files         446      447       +1     
  Lines       18407    18446      +39     
==========================================
- Hits        12705    12703       -2     
- Misses       4760     4807      +47     
+ Partials      942      936       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@ernado ernado merged commit 131dfb7 into gotd:main Jan 6, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a sugared wrapper around takeout functions

2 participants