1
0
Fork 0
mirror of synced 2024-05-19 20:12:30 +12:00

Changed nsfw commands into subcommands

This commit is contained in:
Phxntxm 2016-07-09 14:38:48 -05:00
parent 4ddd6f6ac7
commit 64db88544d

View file

@ -9,10 +9,15 @@ class Mod:
def __init__(self, bot):
self.bot = bot
@commands.command(pass_context=True)
@commands.group(pass_context=True)
async def nsfw(self, ctx)
"""Handles adding or removing a channel as a nsfw channel"""
if ctx.invoked_subcommand is None:
await self.bot.say('Invalid subcommand passed: {0.subcommand_passed}'.format(ctx))
@nsfw.command(name="add", pass_context=True)
@checks.isMod()
async def nsfw(self, ctx):
async def nsfw_add(self, ctx):
"""Registers this channel as a 'nsfw' channel"""
cursor = config.getCursor()
cursor.execute('use {}'.format(config.db_default))
@ -25,9 +30,9 @@ class Mod:
config.closeConnection()
await self.bot.say("This channel has just been registered as 'nsfw'! Have fun you naughties ;)")
@commands.command(pass_context=True)
@nsfw.command(name="remove", aliases=["delete"], pass_context=True)
@checks.isMod()
async def unnsfw(self, ctx):
async def nsfw_remove(self, ctx):
"""Removes this channel as a 'nsfw' channel"""
cursor = config.getCursor()
cursor.execute('use {}'.format(config.db_default))