Enforce name minimums on media feeds

This commit is contained in:
Zeva Rose 2022-04-20 13:06:10 -06:00
parent 3e3fb55e35
commit 6f837d9ad3
2 changed files with 2 additions and 2 deletions

View file

@ -53,7 +53,7 @@ class RedditCog(Scale):
@check(admin_or_permissions(Permissions.MANAGE_GUILD)) @check(admin_or_permissions(Permissions.MANAGE_GUILD))
async def _reddit_follow(self, ctx: InteractionContext, name: str, channel: GuildText) -> None: async def _reddit_follow(self, ctx: InteractionContext, name: str, channel: GuildText) -> None:
name = name.replace("r/", "") name = name.replace("r/", "")
if len(name) > 20: if len(name) > 20 or len(name) < 3:
await ctx.send("Invalid Subreddit name", ephemeral=True) await ctx.send("Invalid Subreddit name", ephemeral=True)
return return

View file

@ -63,7 +63,7 @@ class TwitterCog(Scale):
self, ctx: InteractionContext, handle: str, channel: GuildText, retweets: bool = True self, ctx: InteractionContext, handle: str, channel: GuildText, retweets: bool = True
) -> None: ) -> None:
handle = handle.lower() handle = handle.lower()
if len(handle) > 15: if len(handle) > 15 or len(handle) < 4:
await ctx.send("Invalid Twitter handle", ephemeral=True) await ctx.send("Invalid Twitter handle", ephemeral=True)
return return