forwardMessages with send_copy is unreliable for bot accounts — it
queues an internal download+reupload that can silently fail.
New approach:
1. getMessage to get the file's remote ID from the dest channel
2. sendMessage with inputMessageDocument + inputFileRemote to send
directly to the user (no re-upload needed, file is already on
Telegram's servers)
3. waitForSendConfirmation to actually verify delivery via
updateMessageSendSucceeded/Failed
Also removed getChats call (not available to bot accounts).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The bot may not have the source channel loaded in TDLib's internal
state. Calling getChat first ensures it's resolved. Also added result
logging to diagnose silent send failures.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
send_copy requires re-uploading which may silently fail for bots.
Regular forward is more reliable. Added logging to debug delivery.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Without getChats after login, TDLib doesn't know about the destination
channel and forwardMessages fails with "Chat not found".
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Replace 0n literals with BigInt(0) for ES2017 target compatibility
- Parse link code JSON to extract userId and check expiration (was
passing raw JSON string as FK, causing constraint violation)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>