Skip to content

Commit

Permalink
Fix README and condense decorators
Browse files Browse the repository at this point in the history
  • Loading branch information
Kenny2github committed Jan 6, 2021
1 parent 0d92d8e commit 3786a4a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
6 changes: 3 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@ Notes
information is still available.
* All descriptions are **required**.

Not Yet Supported
=================
* Subcommands
See the wiki_.

.. _wiki: https://github.com/Kenny2github/discord-ext-slash/wiki
13 changes: 5 additions & 8 deletions discord/ext/slash/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ async def repeat( # command name
import discord
from discord.ext import commands

__version__ = '0.1.0'
__version__ = '0.1.1'

class ApplicationCommandOptionType(IntEnum):
"""Possible option types. Default is ``STRING``."""
Expand Down Expand Up @@ -499,8 +499,7 @@ def decorator(func):
def add_slash(self, func, **kwargs):
"""See :class:`Command` doc"""
kwargs['parent'] = self
cmd = Command(func, **kwargs)
self.slash[cmd.name] = cmd
self.slash_cmd(**kwargs)(func)

def slash_group(self, **kwargs):
"""See :class:`Group` doc"""
Expand All @@ -514,8 +513,7 @@ def decorator(func):
def add_slash_group(self, func, **kwargs):
"""See :class:`Group` doc"""
kwargs['parent'] = self
group = Group(func, **kwargs)
self.slash[group.name] = group
self.slash_group(**kwargs)(func)

def to_dict(self):
data = {
Expand Down Expand Up @@ -580,7 +578,7 @@ def decorator(func):

def add_slash(self, func, **kwargs):
"""See :class:`Command` doc"""
self.slash.add(Command(func, **kwargs))
self.slash_cmd(**kwargs)(func)

def slash_group(self, **kwargs):
"""See :class:`Group` doc"""
Expand All @@ -592,8 +590,7 @@ def decorator(func):

def add_slash_group(self, func, **kwargs):
"""See :class:`Group` doc"""
group = Group(func, **kwargs)
self.slash.add(group)
self.slash_group(**kwargs)(func)

def add_slash_cog(self, cog):
"""Add all attributes of ``cog`` that are
Expand Down

0 comments on commit 3786a4a

Please sign in to comment.