Skip to content

Commit 42f6fd6

Browse files
committed
Move SlashCommandOptionType from client.py to model.py.
1 parent 952519a commit 42f6fd6

File tree

3 files changed

+16
-16
lines changed

3 files changed

+16
-16
lines changed

discord_slash/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"""
1010

1111
from .client import SlashCommand
12-
from .client import SlashCommandOptionType
12+
from .model import SlashCommandOptionType
1313
from .model import SlashContext
1414
from .utils import manage_commands
1515

discord_slash/client.py

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
from . import model
88
from . import error
99
from .utils import manage_commands
10-
from enum import IntEnum
1110

1211

1312
class SlashCommand:
@@ -733,17 +732,3 @@ async def on_slash_command_error(ctx, ex):
733732
return
734733
# Prints exception if not overrided or has no listener for error.
735734
self.logger.exception(f"An exception has occurred while executing command `{ctx.name}`:")
736-
737-
738-
class SlashCommandOptionType(IntEnum):
739-
"""
740-
Equivalent of `ApplicationCommandOptionType <https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype>`_ in the Discord API.
741-
"""
742-
SUB_COMMAND = 1
743-
SUB_COMMAND_GROUP = 2
744-
STRING = 3
745-
INTEGER = 4
746-
BOOLEAN = 5
747-
USER = 6
748-
CHANNEL = 7
749-
ROLE = 8

discord_slash/model.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
from discord.ext import commands
44
from . import http
55
from . import error
6+
from enum import IntEnum
67

78

89
class SlashContext:
@@ -282,3 +283,17 @@ def invoke(self, *args):
282283
:return: Coroutine
283284
"""
284285
return self.func(self.cog, *args)
286+
287+
288+
class SlashCommandOptionType(IntEnum):
289+
"""
290+
Equivalent of `ApplicationCommandOptionType <https://discord.com/developers/docs/interactions/slash-commands#applicationcommandoptiontype>`_ in the Discord API.
291+
"""
292+
SUB_COMMAND = 1
293+
SUB_COMMAND_GROUP = 2
294+
STRING = 3
295+
INTEGER = 4
296+
BOOLEAN = 5
297+
USER = 6
298+
CHANNEL = 7
299+
ROLE = 8

0 commit comments

Comments
 (0)