1
0
Fork 0
mirror of synced 2024-06-10 06:34:33 +12:00

Corrected all cases of no_pm, to ensure all commands are set as they should.

This commit is contained in:
Phxntxm 2016-10-06 20:16:25 -05:00
parent 775da3ae63
commit e00985c1c7
5 changed files with 13 additions and 13 deletions

View file

@ -70,14 +70,14 @@ class Mod:
fmt = "notify" if on_off else "not notify"
await self.bot.say("This server will now {} if someone has joined or left".format(fmt))
@commands.group(pass_context=True, no_pm=True)
@commands.group(pass_context=True)
async def nsfw(self, ctx):
"""Handles adding or removing a channel as a nsfw channel"""
# This command isn't meant to do anything, so just send an error if an invalid subcommand is passed
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, no_pm=True)
@nsfw.command(name="add", pass_context=True)
@checks.custom_perms(kick_members=True)
async def nsfw_add(self, ctx):
"""Registers this channel as a 'nsfw' channel"""
@ -87,7 +87,7 @@ class Mod:
else:
await self.bot.say("This channel is already registered as 'nsfw'!")
@nsfw.command(name="remove", aliases=["delete"], pass_context=True, no_pm=True)
@nsfw.command(name="remove", aliases=["delete"], pass_context=True)
@checks.custom_perms(kick_members=True)
async def nsfw_remove(self, ctx):
"""Removes this channel as a 'nsfw' channel"""
@ -97,7 +97,7 @@ class Mod:
else:
await self.bot.say("This channel is not registered as a ''nsfw' channel!")
@commands.command(pass_context=True, no_pm=True)
@commands.command(pass_context=True)
@checks.custom_perms(kick_members=True)
async def say(self, ctx, *, msg: str):
"""Tells the bot to repeat what you say"""

View file

@ -33,7 +33,7 @@ class Overwatch:
Capitalization also matters"""
pass
@ow.command(name="stats", pass_context=True, no_pm=True)
@ow.command(name="stats", pass_context=True)
@checks.custom_perms(send_messages=True)
async def ow_stats(self, ctx, user: discord.Member = None, hero: str = ""):
"""Prints out a basic overview of a member's stats
@ -87,14 +87,14 @@ class Overwatch:
output_data["Kill Death Ratio"] = "{0:.2f}".format(
data['general_stats'].get('eliminations') / data['general_stats'].get('deaths'))
if ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
if ctx.message.channel.is_private or ctx.message.channel.permissions_for(ctx.message.server.me).attach_files:
banner = await images.create_banner(user, "Overwatch", output_data)
await self.bot.upload(banner)
else:
fmt = "\n".join("{}: {}".format(k, r) for k, r in output_data)
await self.bot.say("Overwatch stats for {}: ```py\n{}```".format(user.name, fmt))
@ow.command(pass_context=True, name="add", no_pm=True)
@ow.command(pass_context=True, name="add")
@checks.custom_perms(send_messages=True)
async def add(self, ctx, bt: str):
"""Saves your battletag for looking up information"""
@ -123,7 +123,7 @@ class Overwatch:
await config.update_content('overwatch', update, r_filter)
await self.bot.say("I have just saved your battletag {}".format(ctx.message.author.mention))
@ow.command(pass_context=True, name="delete", aliases=['remove'], no_pm=True)
@ow.command(pass_context=True, name="delete", aliases=['remove'])
@checks.custom_perms(send_messages=True)
async def delete(self, ctx):
"""Removes your battletag from the records"""

View file

@ -102,7 +102,7 @@ class Picarto:
await config.update_content('picarto', {'live': 0}, {'member_id': m_id})
await asyncio.sleep(30)
@commands.group(pass_context=True, invoke_without_command=True)
@commands.group(pass_context=True, invoke_without_command=True, no_pm=True)
@checks.custom_perms(send_messages=True)
async def picarto(self, ctx, member: discord.Member = None):
"""This command can be used to view Picarto stats about a certain member"""

View file

@ -11,7 +11,7 @@ if not discord.opus.is_loaded():
discord.opus.load_opus('/usr/lib64/libopus.so.0')
class VoicePlayer:
class VoicePlayer:server
# This does not need to match up too closely to the StreamPlayer that is "technically" used here
# This is more of a placeholder, just to keep the information that will be requested
# Before the video is actually downloaded, which happens in our audio player task

View file

@ -31,7 +31,7 @@ class Strawpoll:
'Content-Type': 'application/json'}
self.session = aiohttp.ClientSession()
@commands.group(aliases=['strawpoll', 'poll', 'polls'], pass_context=True, invoke_without_command=True)
@commands.group(aliases=['strawpoll', 'poll', 'polls'], pass_context=True, invoke_without_command=True, no_pm=True)
@checks.custom_perms(send_messages=True)
async def strawpolls(self, ctx, poll_id: str = None):
"""This command can be used to show a strawpoll setup on this server"""
@ -77,7 +77,7 @@ class Strawpoll:
created_ago, fmt_options)
await self.bot.say("```\n{}```".format(fmt))
@strawpolls.command(name='create', aliases=['setup', 'add'], pass_context=True)
@strawpolls.command(name='create', aliases=['setup', 'add'], pass_context=True, no_pm=True)
@checks.custom_perms(kick_members=True)
async def create_strawpoll(self, ctx, title, *, options):
"""This command is used to setup a new strawpoll
@ -131,7 +131,7 @@ class Strawpoll:
await config.add_content('strawpolls', entry, {'poll_id': poll_id})
await self.bot.say("Link for your new strawpoll: https://strawpoll.me/{}".format(poll_id))
@strawpolls.command(name='delete', aliases=['remove', 'stop'], pass_context=True)
@strawpolls.command(name='delete', aliases=['remove', 'stop'], pass_context=True, no_pm=True)
@checks.custom_perms(kick_members=True)
async def remove_strawpoll(self, ctx, poll_id):
"""This command can be used to delete one of the existing strawpolls"""