Throwing error if the prefix specified is greater than 5 characters

Added space in prefix if it is greater than 1 character (Testing)
pull/8/head
sgoudham 4 years ago
parent e7c62fd3a8
commit 7de6032305

@ -111,9 +111,12 @@ async def _ping(ctx):
async def change_prefix(ctx, new: Optional[str]): async def change_prefix(ctx, new: Optional[str]):
# As long as a new prefix has been given and is less than 5 characters # As long as a new prefix has been given and is less than 5 characters
if new and len(new) < 5: if new and len(new) < 5:
if len(new) > 1:
# Store the new prefix in the dictionary and update the database spaced_prefix = f"{new} "
await storage_prefix_for_guild(ctx, new) await storage_prefix_for_guild(ctx, new)
else:
# Store the new prefix in the dictionary and update the database
await storage_prefix_for_guild(ctx, new)
# Making sure that errors are handled if prefix is above 5 characters # Making sure that errors are handled if prefix is above 5 characters
elif new and len(new) > 5: elif new and len(new) > 5:

Loading…
Cancel
Save