From 6f837d9ad37351355d9d17289363472b23836ae7 Mon Sep 17 00:00:00 2001 From: Zevaryx Date: Wed, 20 Apr 2022 13:06:10 -0600 Subject: [PATCH] Enforce name minimums on media feeds --- jarvis/cogs/reddit.py | 2 +- jarvis/cogs/twitter.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/jarvis/cogs/reddit.py b/jarvis/cogs/reddit.py index 289701f..8838a9f 100644 --- a/jarvis/cogs/reddit.py +++ b/jarvis/cogs/reddit.py @@ -53,7 +53,7 @@ class RedditCog(Scale): @check(admin_or_permissions(Permissions.MANAGE_GUILD)) async def _reddit_follow(self, ctx: InteractionContext, name: str, channel: GuildText) -> None: name = name.replace("r/", "") - if len(name) > 20: + if len(name) > 20 or len(name) < 3: await ctx.send("Invalid Subreddit name", ephemeral=True) return diff --git a/jarvis/cogs/twitter.py b/jarvis/cogs/twitter.py index 326ee3a..733893d 100644 --- a/jarvis/cogs/twitter.py +++ b/jarvis/cogs/twitter.py @@ -63,7 +63,7 @@ class TwitterCog(Scale): self, ctx: InteractionContext, handle: str, channel: GuildText, retweets: bool = True ) -> None: handle = handle.lower() - if len(handle) > 15: + if len(handle) > 15 or len(handle) < 4: await ctx.send("Invalid Twitter handle", ephemeral=True) return