Making prefix argument appear

Added commentary
pull/8/head
sgoudham 4 years ago
parent f5b1a5b3c1
commit 5068c7e7fd

@ -1,7 +1,6 @@
import asyncio
import datetime
from contextlib import closing
from typing import Optional
import discord
import mariadb
@ -92,7 +91,7 @@ client = commands.Bot( # Create a new bot
description='All current available commands within Ensō~Chan', # Set a description for the bot
owner_id=154840866496839680, # Your unique User ID
version=get_version) # Version number of Ensō~Chan
client.remove_command("help")
client.remove_command("help") # Remove
if __name__ == '__main__':
for ext in settings.extensions():
@ -206,15 +205,11 @@ async def _help(ctx, *, command: str = None):
@client.command(name="prefix", aliases=["Prefix"])
@guild_only()
@has_permissions(manage_guild=True)
async def change_prefix(ctx, new: Optional[str]):
async def change_prefix(ctx, new: str = None):
"""View/Change Guild Prefix"""
# As long as a new prefix has been given and is less than 5 characters
if new and len(new) < 5:
if len(new) > 1:
spaced_prefix = f"{new} "
await storage_prefix_for_guild(ctx, spaced_prefix)
else:
# Store the new prefix in the dictionary and update the database
await storage_prefix_for_guild(ctx, new)

Loading…
Cancel
Save