Skip to content

feat(framework): rate limiting and opts-based API migration#97

Merged
wrxck merged 3 commits intodevelopfrom
feat/framework-hardening
Feb 13, 2026
Merged

feat(framework): rate limiting and opts-based API migration#97
wrxck merged 3 commits intodevelopfrom
feat/framework-hardening

Conversation

@wrxck
Copy link
Owner

@wrxck wrxck commented Feb 13, 2026

Summary

  • Add Redis-based rate limiting for callback queries (5/3s per user with toast notification) and inline queries (3/2s per user with silent drop)
  • Migrate priority plugins to opts-based api.send_message() calls, eliminating deprecation warnings from telegram-bot-lua compat layer:
    • help.lua, about.lua, id.lua, wordfilter.lua, join_captcha.lua, gif.lua

Depends on #94 (router expansion).

Test plan

  • Rapidly spam inline buttons — verify rate limit toast appears after 5 clicks
  • Rapidly use inline mode — verify queries are silently dropped after 3/2s
  • Verify /help menu navigation still works with opts-based calls
  • Verify /about, /id, /wordfilter, captcha, /gif all work normally

🤖 Generated with Claude Code

Matt Hesketh added 3 commits February 13, 2026 00:32
Rate limiting:
- Add Redis-based rate limiting for callback queries (5/3s per user)
  with toast notification on rate limit hit
- Add Redis-based rate limiting for inline queries (3/2s per user)
  with silent drop on rate limit hit

Opts-based migration (priority plugins):
- help.lua: migrate all send_message/edit_message_text calls from
  positional args to opts table format
- about.lua: migrate send_message to opts
- id.lua: migrate send_message to opts
- wordfilter.lua: migrate send_message calls to opts
- join_captcha.lua: migrate send_message to opts
- gif.lua: migrate send_message to opts

This eliminates deprecation warnings from the telegram-bot-lua compat
layer for these high-traffic plugins.
# Conflicts:
#	src/core/router.lua
#	src/plugins/admin/join_captcha.lua
#	src/plugins/utility/help.lua
@wrxck wrxck merged commit bb2d1b8 into develop Feb 13, 2026
1 check 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.

1 participant