Add character limit to descriptions. Closes #14
This commit is contained in:
parent
16173e428b
commit
5930f490ce
@ -63,6 +63,10 @@ async def member_set(ctx: CommandContext):
|
|||||||
if bounds_error:
|
if bounds_error:
|
||||||
return CommandError(bounds_error)
|
return CommandError(bounds_error)
|
||||||
|
|
||||||
|
if prop == "description":
|
||||||
|
if len(value) > 1024:
|
||||||
|
return CommandError("You can't have a description longer than 1024 characters.")
|
||||||
|
|
||||||
if prop == "color":
|
if prop == "color":
|
||||||
match = re.fullmatch("#?([0-9A-Fa-f]{6})", value)
|
match = re.fullmatch("#?([0-9A-Fa-f]{6})", value)
|
||||||
if not match:
|
if not match:
|
||||||
|
@ -59,6 +59,10 @@ async def system_set(ctx: CommandContext):
|
|||||||
if ctx.has_next():
|
if ctx.has_next():
|
||||||
value = ctx.remaining()
|
value = ctx.remaining()
|
||||||
# Sanity checking
|
# Sanity checking
|
||||||
|
if prop == "description":
|
||||||
|
if len(value) > 1024:
|
||||||
|
return CommandError("You can't have a description longer than 1024 characters.")
|
||||||
|
|
||||||
if prop == "tag":
|
if prop == "tag":
|
||||||
if len(value) > 32:
|
if len(value) > 32:
|
||||||
return CommandError("You can't have a system tag longer than 32 characters.")
|
return CommandError("You can't have a system tag longer than 32 characters.")
|
||||||
|
Loading…
Reference in New Issue
Block a user