Skip to content

Commit 024d897

Browse files
silasaryLordOfPolls
authored andcommitted
feat: Warn if people try to run d.py alongside interactions (#1440)
* feat: Warn if people try to run d.py alongside interactions * refactor: Move d.py check to __init__.py
1 parent edef822 commit 024d897

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

interactions/__init__.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
from .client import (
23
__api_version__,
34
__py_version__,
@@ -680,6 +681,10 @@
680681
"WebSocketOPCode",
681682
)
682683

684+
if "discord" in sys.modules:
685+
get_logger().error(
686+
"`import discord` import detected. Interactions.py is a completely separate library, and is not compatible with d.py models. Please see https://interactions-py.github.io/interactions.py/Guides/100%20Migration%20From%20D.py/ for how to fix your code."
687+
)
683688

684689
########################################################################################################################
685690
# Noteworthy Credits

0 commit comments

Comments
 (0)