Skip to content

Commit 6885d60

Browse files
authored
Merge branch 'Pycord-Development:master' into master
2 parents b335b8c + 0357b1e commit 6885d60

File tree

5 files changed

+19
-19
lines changed

5 files changed

+19
-19
lines changed

discord/app/commands.py

Whitespace-only changes.

discord/commands/commands.py

Lines changed: 14 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ class ApplicationCommand(_BaseCommand):
102102
cog = None
103103

104104
def __repr__(self):
105-
return f"<discord.app.commands.{self.__class__.__name__} name={self.name}>"
105+
return f"<discord.commands.{self.__class__.__name__} name={self.name}>"
106106

107107
def __eq__(self, other):
108108
return isinstance(other, self.__class__)
@@ -507,21 +507,20 @@ def __init__(
507507
self._converter = None
508508
self.channel_types: List[SlashCommandOptionType] = kwargs.pop("channel_types", [])
509509
if not isinstance(input_type, SlashCommandOptionType):
510-
to_assign = input_type() if isinstance(input_type, type) else input_type
511-
_type = SlashCommandOptionType.from_datatype(to_assign.__class__)
512-
if _type == SlashCommandOptionType.custom:
513-
self._converter = to_assign
510+
if hasattr(input_type, "convert"):
511+
self._converter = input_type
514512
input_type = SlashCommandOptionType.string
515-
elif _type == SlashCommandOptionType.channel:
516-
if not isinstance(input_type, tuple):
517-
input_type = (input_type,)
518-
for i in input_type:
519-
if i.__name__ == 'GuildChannel':
520-
continue
521-
522-
channel_type = channel_type_map[i.__name__]
523-
self.channel_types.append(channel_type)
524513
else:
514+
_type = SlashCommandOptionType.from_datatype(input_type)
515+
if _type == SlashCommandOptionType.channel:
516+
if not isinstance(input_type, tuple):
517+
input_type = (input_type,)
518+
for i in input_type:
519+
if i.__name__ == 'GuildChannel':
520+
continue
521+
522+
channel_type = channel_type_map[i.__name__]
523+
self.channel_types.append(channel_type)
525524
input_type = _type
526525
self.input_type = input_type
527526
self.required: bool = kwargs.pop("required", True)
@@ -546,7 +545,7 @@ def to_dict(self) -> Dict:
546545

547546

548547
def __repr__(self):
549-
return f"<discord.app.commands.{self.__class__.__name__} name={self.name}>"
548+
return f"<discord.commands.{self.__class__.__name__} name={self.name}>"
550549

551550

552551
class OptionChoice:

discord/commands/context.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,8 +113,8 @@ def followup(self):
113113
return self.interaction.followup
114114

115115
async def delete(self):
116-
"""Calls :attr:`~discord.app.ApplicationContext.respond`.
117-
If the response is done, then calls :attr:`~discord.app.ApplicationContext.respond` first."""
116+
"""Calls :attr:`~discord.commands.ApplicationContext.respond`.
117+
If the response is done, then calls :attr:`~discord.commands.ApplicationContext.respond` first."""
118118
if not self.response.is_done():
119119
await self.defer()
120120

examples/app_commands/slash_groups.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ async def add(ctx, num1: int, num2: int):
1818

1919
# another way, creating the class manually
2020

21-
from discord.app import SlashCommandGroup
21+
from discord.commands import SlashCommandGroup
2222

2323
math = SlashCommandGroup("math", "Commands related to mathematics.")
2424

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,14 @@
7373
extras_require=extras_require,
7474
python_requires='>=3.8.0',
7575
classifiers=[
76-
'Development Status :: 5 - Production/Stable',
76+
'Development Status :: 3 - Alpha',
7777
'License :: OSI Approved :: MIT License',
7878
'Intended Audience :: Developers',
7979
'Natural Language :: English',
8080
'Operating System :: OS Independent',
8181
'Programming Language :: Python :: 3.8',
8282
'Programming Language :: Python :: 3.9',
83+
'Programming Language :: Python :: 3.10'
8384
'Topic :: Internet',
8485
'Topic :: Software Development :: Libraries',
8586
'Topic :: Software Development :: Libraries :: Python Modules',

0 commit comments

Comments
 (0)