Skip to content

Commit 0b1449e

Browse files
committed
Rename to BaseCommandObject
1 parent c725978 commit 0b1449e

File tree

3 files changed

+11
-11
lines changed

3 files changed

+11
-11
lines changed

discord_slash/client.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,10 @@ def get_cog_commands(self, cog: commands.Cog):
112112
"to add cog slash commands. Make sure to remove all calls to this function.")
113113
cog._slash_registered = True # Assuming all went well
114114
func_list = [getattr(cog, x) for x in dir(cog)]
115-
res = [x for x in func_list if isinstance(x, (model.CogBasecommandObject, model.CogSubcommandObject))]
115+
res = [x for x in func_list if isinstance(x, (model.CogBaseCommandObject, model.CogSubcommandObject))]
116116
for x in res:
117117
x.cog = cog
118-
if isinstance(x, model.CogBasecommandObject):
118+
if isinstance(x, model.CogBaseCommandObject):
119119
if x.name in self.commands:
120120
raise error.DuplicateCommand(x.name)
121121
self.commands[x.name] = x
@@ -126,7 +126,7 @@ def get_cog_commands(self, cog: commands.Cog):
126126
self.commands[x.base].allowed_guild_ids.append(i)
127127
self.commands[x.base].has_subcommands = True
128128
else:
129-
self.commands[x.base] = model.BasecommandObject(x.base, x.base_command_data)
129+
self.commands[x.base] = model.BaseCommandObject(x.base, x.base_command_data)
130130
if x.base not in self.subcommands:
131131
self.subcommands[x.base] = {}
132132
if x.subcommand_group:
@@ -154,9 +154,9 @@ def remove_cog_commands(self, cog):
154154
del cog._slash_registered
155155
func_list = [getattr(cog, x) for x in dir(cog)]
156156
res = [x for x in func_list if
157-
isinstance(x, (model.CogBasecommandObject, model.CogSubcommandObject))]
157+
isinstance(x, (model.CogBaseCommandObject, model.CogSubcommandObject))]
158158
for x in res:
159-
if isinstance(x, model.CogBasecommandObject):
159+
if isinstance(x, model.CogBaseCommandObject):
160160
if x.name not in self.commands:
161161
continue # Just in case it is removed due to subcommand.
162162
if x.name in self.subcommands:
@@ -479,7 +479,7 @@ def add_slash_command(self,
479479
"connector": connector or {},
480480
"has_subcommands": has_subcommands
481481
}
482-
obj = model.BasecommandObject(name, _cmd)
482+
obj = model.BaseCommandObject(name, _cmd)
483483
self.commands[name] = obj
484484
self.logger.debug(f"Added command `{name}`")
485485
return obj
@@ -561,7 +561,7 @@ def add_subcommand(self,
561561
"connector": connector or {}
562562
}
563563
if base not in self.commands:
564-
self.commands[base] = model.BasecommandObject(base, _cmd)
564+
self.commands[base] = model.BaseCommandObject(base, _cmd)
565565
else:
566566
base_command = self.commands[base]
567567
base_command.has_subcommands = True

discord_slash/cog_ext.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import typing
22
import inspect
3-
from .model import CogBasecommandObject, CogSubcommandObject
3+
from .model import CogBaseCommandObject, CogSubcommandObject
44
from .utils import manage_commands
55

66

@@ -60,7 +60,7 @@ def wrapper(cmd):
6060
"connector": connector,
6161
"has_subcommands": False
6262
}
63-
return CogBasecommandObject(name or cmd.__name__, _cmd)
63+
return CogBaseCommandObject(name or cmd.__name__, _cmd)
6464
return wrapper
6565

6666

discord_slash/model.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ async def can_run(self, ctx) -> bool:
175175
return False not in res
176176

177177

178-
class BasecommandObject(CommandObject):
178+
class BaseCommandObject(CommandObject):
179179
"""
180180
BaseCommand object of this extension.
181181
@@ -221,7 +221,7 @@ def __init__(self, sub, base, name, sub_group=None):
221221
self.subcommand_group_description = sub["sub_group_desc"]
222222

223223

224-
class CogBasecommandObject(BasecommandObject):
224+
class CogBaseCommandObject(BaseCommandObject):
225225
"""
226226
Slash command object but for Cog.
227227

0 commit comments

Comments
 (0)