From e00985c1c780b4f95cfb1e5c7565c46422197fb9 Mon Sep 17 00:00:00 2001 From: Phxntxm Date: Thu, 6 Oct 2016 20:16:25 -0500 Subject: [PATCH] Corrected all cases of no_pm, to ensure all commands are set as they should. --- cogs/mod.py | 8 ++++---- cogs/overwatch.py | 8 ++++---- cogs/picarto.py | 2 +- cogs/playlist.py | 2 +- cogs/strawpoll.py | 6 +++--- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/cogs/mod.py b/cogs/mod.py index d14b541..cac6a6c 100644 --- a/cogs/mod.py +++ b/cogs/mod.py @@ -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""" diff --git a/cogs/overwatch.py b/cogs/overwatch.py index ce11545..935f37e 100644 --- a/cogs/overwatch.py +++ b/cogs/overwatch.py @@ -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""" diff --git a/cogs/picarto.py b/cogs/picarto.py index f8d17f3..3e68ebd 100644 --- a/cogs/picarto.py +++ b/cogs/picarto.py @@ -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""" diff --git a/cogs/playlist.py b/cogs/playlist.py index 2de4cca..63e680a 100644 --- a/cogs/playlist.py +++ b/cogs/playlist.py @@ -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 diff --git a/cogs/strawpoll.py b/cogs/strawpoll.py index 9c01838..629f182 100644 --- a/cogs/strawpoll.py +++ b/cogs/strawpoll.py @@ -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"""