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:
parent
d1a1a09a70
commit
8f3d7dfcc0
2 changed files with 25 additions and 0 deletions
|
|
@ -1,3 +1,5 @@
|
|||
from __future__ import annotations
|
||||
|
||||
"""
|
||||
Discord platform adapter.
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue