Skip to content

feat(compat): full v2 migration support#37

Merged
wrxck merged 1 commit intodevelopfrom
feat/v2-migration-compat
Feb 21, 2026
Merged

feat(compat): full v2 migration support#37
wrxck merged 1 commit intodevelopfrom
feat/v2-migration-compat

Conversation

@wrxck
Copy link
Owner

@wrxck wrxck commented Feb 21, 2026

Summary

  • Expand compat layer with positional-arg shims for api.run(), get_updates(), set_webhook(), and all media methods (send_photo, send_video, send_document, send_audio, send_voice, send_animation, send_sticker)
  • Fix send_message() compat to handle v2's full positional signature (nil thread_id + parse_mode pattern)
  • Add migration guide to README with before/after code examples

Changes

  • src/compat.lua — expanded from 3 shims to 15 (run, get_updates, set_webhook, send_message fix, 7 media methods)
  • spec/compat_spec.lua — expanded from 10 to 38 tests covering all v2 call patterns
  • README.md — added "Migrating from v2" section, fixed module structure listing

Test plan

  • All 567 tests pass (38 compat + 84 module + 445 existing)
  • Luacheck clean (0 warnings, 0 errors)
  • Verified v2-style code against LuaRocks-installed v3 (require path, positional args, media methods)

Expand the compatibility layer so v2 code runs on v3 with deprecation
warnings. Adds positional-arg detection and conversion for api.run(),
get_updates(), set_webhook(), send_message() (incl. nil+parse_mode
pattern), and all media methods (send_photo, send_video, send_document,
send_audio, send_voice, send_animation, send_sticker).

Adds migration guide to README with before/after examples.
@wrxck wrxck merged commit 607f0d0 into develop Feb 21, 2026
3 checks passed
@wrxck wrxck mentioned this pull request Feb 21, 2026
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.

1 participant