Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added censor and fixed requirements #75

Merged
merged 4 commits into from
Jan 13, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions cogs/AI.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import base64
import time
from io import BytesIO

from better_profanity import profanity
import disnake
from disnake.ext import commands

Expand All @@ -13,7 +13,10 @@ 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)
OpenSourceSimon marked this conversation as resolved.
Show resolved Hide resolved
ETA = int(time.time() + 60)
await inter.send(
f"Go grab a coffee this may take a while... ETA: <t:{ETA}:R>",
Expand Down
4 changes: 2 additions & 2 deletions cogs/Password.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
)


Expand Down
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 0 additions & 14 deletions secrets.env.template

This file was deleted.