Skip to content

Commit d49b015

Browse files
committed
fix: remove module-level deprecation warn
1 parent 08370b5 commit d49b015

File tree

1 file changed

+22
-8
lines changed

1 file changed

+22
-8
lines changed

discord/ext/bridge/core.py

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -655,11 +655,25 @@ def decorator(func):
655655
return decorator
656656

657657

658-
discord.commands.options.Option = BridgeOption
659-
discord.Option = BridgeOption
660-
warn_deprecated(
661-
"Option",
662-
"BridgeOption",
663-
"2.5",
664-
reference="https://github.com/Pycord-Development/pycord/pull/2417",
665-
)
658+
# TODO: Fix this, it doesn't work if discord.Option is imported before discord.ext.bridge
659+
660+
661+
# TODO: 2.7: Remove this
662+
class BridgeOptionDeprecated(BridgeOption):
663+
@staticmethod
664+
def _warn():
665+
warn_deprecated(
666+
"Option",
667+
"BridgeOption",
668+
"2.5",
669+
"2.7",
670+
reference="https://github.com/Pycord-Development/pycord/pull/2417",
671+
)
672+
673+
def __init__(self, *args, **kwargs):
674+
self._warn()
675+
super().__init__(*args, **kwargs)
676+
677+
678+
discord.commands.options.Option = BridgeOptionDeprecated
679+
discord.Option = BridgeOptionDeprecated

0 commit comments

Comments
 (0)