Commit graph

2 commits

Author SHA1 Message Date
f3ddb9defb feat(api/cache): add channel-message history, thread creation, snowflakes, cached threads
- Api.get_channel_messages/2,3 (opts + Nostrum-compatible locator), query
  baked into the path so the rate limiter buckets it correctly
- Api.start_thread_with_message/3,4 (POST .../messages/:id/threads)
- Dexcord.Snowflake: from_datetime/to_datetime/to_unix (replaces Nostrum.Snowflake)
- Cache.threads/1: thread-type channels (10/11/12) for a guild
- FakeRest now records query_string so query building is testable

Added to support migrating Alamedya off Nostrum. 178 tests, 0 failures.
2026-07-04 13:12:54 -03:00
50a16666b4 Phase 3: REST rate limiter, typed endpoints, error struct
Add Dexcord.Api.Ratelimit (route->bucket learning, per-bucket windows via
monotonic X-RateLimit-Reset-After deadlines, global lock, injectable clock,
probe serialization for unknown routes). Rework Dexcord.Api.request/4 around
acquire/wait/update with 429 + global handling and up to 3 retries; add the
~16 typed endpoints and a Dexcord.Api.Error struct. Start Ratelimit in the
supervisor after Finch. Add unit tests (route-key table, bucket/global math
with injected clock) and integration tests against a new Dexcord.FakeRest
Bandit server.
2026-07-04 00:26:58 -03:00