Skip to content

Commit

Permalink
cleaned up profile.py
Browse files Browse the repository at this point in the history
  • Loading branch information
nfearnley committed May 21, 2024
1 parent 9843c0f commit 368ab81
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions sizebot/cogs/profile.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from typing import Annotated

import discord
from discord import Embed
from discord.ext import commands
Expand All @@ -9,7 +10,7 @@
from sizebot.lib.utils import is_url


def parse_url(s: str) -> str:
def _parse_url(s: str) -> str:
if not is_url(s):
raise InvalidSizeValue(f"{s} is not a valid URL.")
return s
Expand All @@ -27,7 +28,7 @@ def __init__(self, bot: commands.Bot):
category = "profile"
)
@commands.guild_only()
async def setpicture(self, ctx: BotContext, *, url: Annotated[str, parse_url]):
async def setpicture(self, ctx: BotContext, *, url: Annotated[str, _parse_url]):
""" Set your profile's image. Must be a valid image URL."""
userdata = userdb.load(ctx.guild.id, ctx.author.id, allow_unreg=True)
userdata.picture_url = url
Expand Down

0 comments on commit 368ab81

Please sign in to comment.