fix: defer discord adapter annotations

Prevent gateway.platforms.discord from crashing at import time when discord.py is unavailable. Python 3.11 eagerly evaluates annotations, so using discord.Interaction and similar annotations caused an AttributeError after the optional import fallback set discord=None. Add postponed annotation evaluation and a regression test covering import without discord installed.
This commit is contained in:
teknium1 2026-03-14 09:32:05 -07:00
parent d1a1a09a70
commit 8f3d7dfcc0
2 changed files with 25 additions and 0 deletions

View file

@ -1,3 +1,5 @@
from __future__ import annotations
"""
Discord platform adapter.