[Core] Strip commas in user input for load, reload, unload (#2693)

rstrip commas, closes #2695
This commit is contained in:
zephyrkul 2019-05-16 21:54:17 -06:00 committed by Michael H
parent 21a253103e
commit 7dd3ff7c8d

View File

@ -529,6 +529,7 @@ class Core(commands.Cog, CoreLogic):
"""Loads packages"""
if not cogs:
return await ctx.send_help()
cogs = tuple(map(lambda cog: cog.rstrip(","), cogs))
async with ctx.typing():
loaded, failed, not_found, already_loaded, failed_with_reason = await self._load(cogs)
@ -571,6 +572,7 @@ class Core(commands.Cog, CoreLogic):
"""Unloads packages"""
if not cogs:
return await ctx.send_help()
cogs = tuple(map(lambda cog: cog.rstrip(","), cogs))
unloaded, failed = await self._unload(cogs)
if unloaded:
@ -589,6 +591,7 @@ class Core(commands.Cog, CoreLogic):
"""Reloads packages"""
if not cogs:
return await ctx.send_help()
cogs = tuple(map(lambda cog: cog.rstrip(","), cogs))
async with ctx.typing():
loaded, failed, not_found, already_loaded, failed_with_reason = await self._reload(
cogs