Fix issues in remindme
This commit is contained in:
parent
393487946c
commit
e9f6021c63
1 changed files with 8 additions and 3 deletions
|
@ -25,7 +25,7 @@ from naff.models.naff.application_commands import (
|
|||
|
||||
from jarvis.utils import build_embed
|
||||
|
||||
valid = re.compile(r"[\w\s\-\\/.!@#$%^*()+=<>:,\u0080-\U000E0FFF]*")
|
||||
valid = re.compile(r"[\w\s\-\\/.!@#$%^*()+=<>:'\",\u0080-\U000E0FFF]*")
|
||||
time_pattern = re.compile(r"(\d+\.?\d?[s|m|h|d|w]{1})\s?", flags=re.IGNORECASE)
|
||||
invites = re.compile(
|
||||
r"(?:https?://)?(?:www.)?(?:discord.(?:gg|io|me|li)|discord(?:app)?.com/invite)/([^\s/]+?)(?=\b)", # noqa: E501
|
||||
|
@ -84,8 +84,8 @@ class RemindmeCog(Extension):
|
|||
await ctx.send_modal(modal)
|
||||
try:
|
||||
response = await self.bot.wait_for_modal(modal, author=ctx.author.id, timeout=60 * 5)
|
||||
message = response.responses.get("message")
|
||||
delay = response.responses.get("delay")
|
||||
message = response.responses.get("message").strip()
|
||||
delay = response.responses.get("delay").strip()
|
||||
except asyncio.TimeoutError:
|
||||
return
|
||||
if len(message) > 500:
|
||||
|
@ -100,6 +100,11 @@ class RemindmeCog(Extension):
|
|||
elif not valid.fullmatch(message):
|
||||
await response.send("Hey, you should probably make this readable", ephemeral=True)
|
||||
return
|
||||
elif len(message) == 0:
|
||||
await response.send(
|
||||
"Hey, you should probably add content to your reminder", ephemeral=True
|
||||
)
|
||||
return
|
||||
|
||||
base_settings = {
|
||||
"PREFER_DATES_FROM": "future",
|
||||
|
|
Loading…
Add table
Reference in a new issue