Removed ability to call many commands in pm
This commit is contained in:
parent
195f2ee608
commit
63f00b76ec
|
@ -119,7 +119,7 @@ class Core:
|
|||
fmt = '{0.message.author.name} has rolled {1}, {2} sided dice and got the numbers {3}!'
|
||||
await self.bot.say(fmt.format(ctx, dice, num, valueStr))
|
||||
|
||||
@commands.group(pass_context=True, invoke_without_command=True)
|
||||
@commands.group(pass_context=True, invoke_without_command=True, no_pm=True)
|
||||
async def tag(self, ctx, *tag: str):
|
||||
"""This can be used for custom tags
|
||||
The format to call a custom tag is !tag <tag>"""
|
||||
|
@ -135,7 +135,7 @@ class Core:
|
|||
await self.bot.say("{}".format(result['result']))
|
||||
config.closeConnection()
|
||||
|
||||
@tag.command(name='add', aliases=['create', 'start'], pass_context=True)
|
||||
@tag.command(name='add', aliases=['create', 'start'], pass_context=True, no_pm=True)
|
||||
@checks.customPermsOrRole("kick_members")
|
||||
async def add_tag(self, ctx, *result: str):
|
||||
"""Use this to add a new tag that can be used in this server
|
||||
|
@ -156,7 +156,7 @@ class Core:
|
|||
await self.bot.say("I have just added the tag `{0}`! You can call this tag by entering !tag {0}".format(tag))
|
||||
config.closeConnection()
|
||||
|
||||
@tag.command(name='delete', aliases=['remove', 'stop'], pass_context=True)
|
||||
@tag.command(name='delete', aliases=['remove', 'stop'], pass_context=True, no_pm=True)
|
||||
@checks.customPermsOrRole("kick_members")
|
||||
async def del_tag(self, ctx, *tag: str):
|
||||
"""Use this to remove a tag that from use for this server
|
||||
|
|
12
cogs/mod.py
12
cogs/mod.py
|
@ -18,13 +18,13 @@ class Mod:
|
|||
def __init__(self, bot):
|
||||
self.bot = bot
|
||||
|
||||
@commands.group(pass_context=True)
|
||||
@commands.group(pass_context=True, no_pm=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)
|
||||
@nsfw.command(name="add", pass_context=True, no_pm=True)
|
||||
@checks.customPermsOrRole("kick_members")
|
||||
async def nsfw_add(self, ctx):
|
||||
"""Registers this channel as a 'nsfw' channel"""
|
||||
|
@ -41,7 +41,7 @@ class Mod:
|
|||
|
||||
@nsfw.command(name="remove", aliases=["delete"], pass_context=True)
|
||||
@checks.customPermsOrRole("kick_members")
|
||||
async def nsfw_remove(self, ctx):
|
||||
async def nsfw_remove(self, ctx, no_pm=True):
|
||||
"""Removes this channel as a 'nsfw' channel"""
|
||||
cursor = config.getCursor()
|
||||
cursor.execute('use {}'.format(config.db_default))
|
||||
|
@ -62,7 +62,7 @@ class Mod:
|
|||
await self.bot.say('Why must I leave? Hopefully I can come back :c')
|
||||
await self.bot.leave_server(ctx.message.server)
|
||||
|
||||
@commands.command(pass_context=True)
|
||||
@commands.command(pass_context=True, no_pm=True)
|
||||
@checks.customPermsOrRole("kick_members")
|
||||
async def say(self, ctx, *msg: str):
|
||||
"""Tells the bot to repeat what you say"""
|
||||
|
@ -70,7 +70,7 @@ class Mod:
|
|||
await self.bot.say(msg)
|
||||
await self.bot.delete_message(ctx.message)
|
||||
|
||||
@commands.group(pass_context=True, invoke_without_command=True)
|
||||
@commands.group(pass_context=True, invoke_without_command=True, no_pm=True)
|
||||
async def perms(self, ctx, *command: str):
|
||||
"""This command can be used to print the current allowed permissions on a specific command
|
||||
This supports groups as well as subcommands; pass no argument to print a list of available permissions"""
|
||||
|
@ -97,7 +97,7 @@ class Mod:
|
|||
"You need to have the permission `{}` to use the command `{}` in this server".format(result['perms'],
|
||||
command))
|
||||
|
||||
@perms.command(name="add", aliases=["setup,create"], pass_context=True)
|
||||
@perms.command(name="add", aliases=["setup,create"], pass_context=True, no_pm=True)
|
||||
@checks.customPermsOrRole("manage_server")
|
||||
async def add_perms(self, ctx, *msg: str):
|
||||
"""Sets up custom permissions on the provided command
|
||||
|
|
|
@ -63,7 +63,7 @@ class Overwatch:
|
|||
elif error_no == 404:
|
||||
await self.bot.say("{} is not an actual hero!".format(hero.title()))
|
||||
|
||||
@ow.command(pass_context=True, name="add")
|
||||
@ow.command(pass_context=True, name="add", no_pm=True)
|
||||
async def add(self, ctx, bt: str):
|
||||
"""Saves your battletag for looking up information"""
|
||||
bt = bt.replace("#", "-")
|
||||
|
@ -87,7 +87,7 @@ class Overwatch:
|
|||
await self.bot.say("I have just saved your battletag {}".format(ctx.message.author.mention))
|
||||
config.closeConnection()
|
||||
|
||||
@ow.command(pass_context=True, name="delete", aliases=['remove'])
|
||||
@ow.command(pass_context=True, name="delete", aliases=['remove'], no_pm=True)
|
||||
async def delete(self, ctx):
|
||||
"""Removes your battletag from the records"""
|
||||
cursor = config.getCursor()
|
||||
|
|
|
@ -49,7 +49,7 @@ class Twitch:
|
|||
config.closeConnection()
|
||||
await asyncio.sleep(30)
|
||||
|
||||
@commands.group(no_pm=True, invoke_without_command=True)
|
||||
@commands.group(no_pm=True, invoke_without_command=True, no_pm=True)
|
||||
async def twitch(self, *, member: discord.Member=None):
|
||||
"""Use this command to check the twitch info of a user"""
|
||||
if member is not None:
|
||||
|
|
Loading…
Reference in a new issue