diff --git a/cogs/AI.py b/cogs/AI.py index 5bce980..cce8b1b 100644 --- a/cogs/AI.py +++ b/cogs/AI.py @@ -1,7 +1,7 @@ import base64 import time from io import BytesIO - +from better_profanity import profanity import disnake from disnake.ext import commands @@ -13,11 +13,18 @@ def __init__(self, bot: OGIROID): self.bot = bot @commands.slash_command(description="Generates ai art") - async def ai_art(self, inter: disnake.ApplicationCommandInteraction, text): + async def ai_art(self, inter: disnake.ApplicationCommandInteraction, text: str): + if profanity.censor(text) != text: + return await inter.send(f"NSFW requests are not allowed!", + ephemeral=True) + if "bot" in inter.channel.name or "command" in inter.channel.name: + hidden = False + else: + hidden = True ETA = int(time.time() + 60) await inter.send( f"Go grab a coffee this may take a while... ETA: ", - ephemeral=True, + ephemeral=hidden, ) response = await self.bot.session.post( "https://backend.craiyon.com/generate", json={"prompt": text} diff --git a/cogs/Password.py b/cogs/Password.py index 69f49cd..cc69d5c 100644 --- a/cogs/Password.py +++ b/cogs/Password.py @@ -26,12 +26,12 @@ async def password(self, inter, length: int): ) # try to DM if fails send the password to the channel try: - await inter.author.send(f"Your password is: `{password}`") + await inter.author.send(f"Your password is: ||{password}||") await inter.response.send_message("Your password has been sent!") # If DMs are closed, send the password to the channel except: await inter.response.send_message( - f"Your password is: `{password}`", ephemeral=True + f"Your password is: ||{password}||", ephemeral=True ) diff --git a/requirements.txt b/requirements.txt index c7168a6..c1dd299 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,5 @@ cachetools~=5.2.0 python-dateutil~=2.8.2 pytz==2022.6 asyncpg~=0.27.0 +discord_together==1.2.6 +better_profanity==0.7.0