pull/116/head
bobloy 6 years ago
parent 81cb93a6aa
commit 9a3a62f451

@ -2,4 +2,5 @@ from .nudity import Nudity
def setup(bot): def setup(bot):
bot.add_cog(Nudity(bot)) n = Nudity(bot)
bot.add_cog(n)

@ -17,4 +17,4 @@
"utils", "utils",
"tools" "tools"
] ]
} }

@ -17,14 +17,11 @@ class Nudity:
self.bot = bot self.bot = bot
self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True) self.config = Config.get_conf(self, identifier=9811198108111121, force_registration=True)
default_guild = { default_guild = {"enabled": False, "channel_id": None}
"enabled": False,
"channel_id": None
}
self.config.register_guild(**default_guild) 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): async def nudity(self, ctx: commands.Context):
"""Toggle nude-checking on or off""" """Toggle nude-checking on or off"""
is_on = await self.config.guild(ctx.guild).enabled() is_on = await self.config.guild(ctx.guild).enabled()
@ -73,7 +70,9 @@ class Nudity:
if nsfw_channel is None: if nsfw_channel is None:
return return
else: 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): async def on_message(self, message: discord.Message):
if not message.attachments: if not message.attachments:
@ -115,6 +114,7 @@ class Nudity:
print("Is not nude") print("Is not nude")
await message.add_reaction("") await message.add_reaction("")
# async def fetch_img(session, url): # async def fetch_img(session, url):
# with aiohttp.Timeout(10): # with aiohttp.Timeout(10):
# async with session.get(url) as response: # async with session.get(url) as response:

Loading…
Cancel
Save