Skip to content
This repository was archived by the owner on Mar 8, 2022. It is now read-only.

Commit 2e797a9

Browse files
committed
fixed nextcord import issues
1 parent e0a9560 commit 2e797a9

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

discord_ui/cogs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .tools import deprecated
99

1010
import discord
11-
from discord.errors import InvalidArgument
11+
from discord import InvalidArgument
1212
from discord.ext.commands import Cog, CheckFailure, CooldownMapping, BucketType, CommandOnCooldown
1313

1414
import inspect

discord_ui/components.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
from __future__ import annotations
22

3-
from discord.ext.commands.errors import BadArgument
3+
from discord.ext.commands import BadArgument
44

55
from .tools import All
66
from .enums import ButtonStyle, ComponentType
77
from .errors import InvalidLength, OutOfValidRange, WrongType
88

99
import discord
10-
from discord.errors import InvalidArgument
10+
from discord import InvalidArgument
1111

1212
import inspect
1313
import string

discord_ui/slash/errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from discord.errors import ClientException
1+
from discord import ClientException
22

33
class NoCommandFound(ClientException):
44
"""Exception that is raised when you try to get a command with a name that doesn't exists"""

discord_ui/slash/types.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
)
1515

1616
import discord
17+
from discord import InvalidArgument
1718
from discord.ext.commands import Bot, BadArgument
1819

1920
import re
@@ -662,7 +663,7 @@ def __init__(self, command_type, callback, name=None, description=None, options=
662663
op_type = _type
663664

664665
if OptionType.any_to_type(op_type) is None:
665-
raise discord.errors.InvalidArgument("Could not find a matching option type for parameter '" + str(op_type) + "'")
666+
raise InvalidArgument("Could not find a matching option type for parameter '" + str(op_type) + "'")
666667
_ops.append(SlashOption(op_type, _name, op_desc, required=_val.default == inspect._empty))
667668
self.options = _ops
668669

@@ -778,7 +779,7 @@ def name(self) -> str:
778779
@name.setter
779780
def name(self, value):
780781
if value is None:
781-
raise discord.errors.InvalidArgument("You have to specify a name")
782+
raise InvalidArgument("You have to specify a name")
782783
if not isinstance(value, str):
783784
raise WrongType("name", value, "str")
784785
if len(value) > 32 or len(value) < 1:
@@ -1046,7 +1047,7 @@ def __init__(self, callback, base_names, name, description=None, options=None, g
10461047
if isinstance(base_names, str):
10471048
base_names = [base_names]
10481049
if len(base_names) > 2:
1049-
raise discord.errors.InvalidArgument("subcommand groups are currently limited to 2 bases")
1050+
raise InvalidArgument("subcommand groups are currently limited to 2 bases")
10501051
if any([len(x) > 32 or len(x) < 1 for x in base_names]):
10511052
raise InvalidLength("base_names", 1, 32)
10521053
self.base_names = [format_name(x) for x in base_names]

0 commit comments

Comments
 (0)