[Customcom] Fix error on exiting customcom interactive menu. (#3417)

* [Customcom] Fixes error on exit

* Changelog

* Fixed spelling.

* Typehinting
This commit is contained in:
Stonedestroyer 2020-01-19 18:08:31 +01:00 committed by jack1142
parent 54e65082bc
commit 7f390df879
2 changed files with 4 additions and 0 deletions

View File

@ -0,0 +1 @@
Fixes error on exiting customcom interactive menu.

View File

@ -227,6 +227,9 @@ class CustomCommands(commands.Cog):
await ctx.send(_("There already exists a bot command with the same name.")) await ctx.send(_("There already exists a bot command with the same name."))
return return
responses = await self.commandobj.get_responses(ctx=ctx) responses = await self.commandobj.get_responses(ctx=ctx)
if not responses:
await ctx.send(_("Custom command process cancelled."))
return
try: try:
await self.commandobj.create(ctx=ctx, command=command, response=responses) await self.commandobj.create(ctx=ctx, command=command, response=responses)
await ctx.send(_("Custom command successfully added.")) await ctx.send(_("Custom command successfully added."))