From 9a3a62f451c379aa2350d81353a5ca230b477c87 Mon Sep 17 00:00:00 2001 From: bobloy Date: Tue, 9 Oct 2018 10:08:37 -0400 Subject: [PATCH] updates --- nudity/__init__.py | 3 ++- nudity/info..json | 2 +- nudity/nudity.py | 12 ++++++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/nudity/__init__.py b/nudity/__init__.py index 7d32df6..09d9dbf 100644 --- a/nudity/__init__.py +++ b/nudity/__init__.py @@ -2,4 +2,5 @@ from .nudity import Nudity def setup(bot): - bot.add_cog(Nudity(bot)) + n = Nudity(bot) + bot.add_cog(n) diff --git a/nudity/info..json b/nudity/info..json index d5d6e2d..1d66cf7 100644 --- a/nudity/info..json +++ b/nudity/info..json @@ -17,4 +17,4 @@ "utils", "tools" ] -} \ No newline at end of file +} diff --git a/nudity/nudity.py b/nudity/nudity.py index d7c4fe8..a7290a5 100644 --- a/nudity/nudity.py +++ b/nudity/nudity.py @@ -17,14 +17,11 @@ class Nudity: self.bot = bot self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True) - default_guild = { - "enabled": False, - "channel_id": None - } + default_guild = {"enabled": False, "channel_id": None} self.config.register_guild(**default_guild) - @commands.command(aliases=['togglenudity'], name='nudity') + @commands.command(aliases=["togglenudity"], name="nudity") async def nudity(self, ctx: commands.Context): """Toggle nude-checking on or off""" is_on = await self.config.guild(ctx.guild).enabled() @@ -73,7 +70,9 @@ class Nudity: if nsfw_channel is None: return else: - await nsfw_channel.send("NSFW Image from {}".format(message.channel.mention), file=image) + await nsfw_channel.send( + "NSFW Image from {}".format(message.channel.mention), file=image + ) async def on_message(self, message: discord.Message): if not message.attachments: @@ -115,6 +114,7 @@ class Nudity: print("Is not nude") await message.add_reaction("✅") + # async def fetch_img(session, url): # with aiohttp.Timeout(10): # async with session.get(url) as response: