Fixed issue in sending error messages.
parent
93827f5f90
commit
a13e1c9af2
|
@ -44,9 +44,6 @@ class Commands:
|
||||||
base = self.interface.add_base(session, player, base_name, x_pos, z_pos)
|
base = self.interface.add_base(session, player, base_name, x_pos, z_pos)
|
||||||
|
|
||||||
base_name = base.name
|
base_name = base.name
|
||||||
except EntryNameNotUniqueError:
|
|
||||||
session.rollback()
|
|
||||||
raise EntryNameNotUniqueError
|
|
||||||
finally:
|
finally:
|
||||||
session.close()
|
session.close()
|
||||||
|
|
||||||
|
@ -81,9 +78,6 @@ class Commands:
|
||||||
|
|
||||||
tunnel = self.interface.add_tunnel(session, player, tunnel_color, tunnel_number, location_name)
|
tunnel = self.interface.add_tunnel(session, player, tunnel_color, tunnel_number, location_name)
|
||||||
tunnel_info = tunnel.__str__()
|
tunnel_info = tunnel.__str__()
|
||||||
except EntryNameNotUniqueError:
|
|
||||||
session.rollback()
|
|
||||||
raise EntryNameNotUniqueError
|
|
||||||
finally:
|
finally:
|
||||||
session.close()
|
session.close()
|
||||||
|
|
||||||
|
|
|
@ -48,7 +48,8 @@ async def on_command_error(error, ctx):
|
||||||
else:
|
else:
|
||||||
error_str = bad_error_message.format(ctx.invoked_with, error)
|
error_str = bad_error_message.format(ctx.invoked_with, error)
|
||||||
|
|
||||||
bot.send_message(ctx.message.channel, '**Error Running Command:** {}'.format(error_str))
|
await bot.send_message(ctx.message.channel, '{} **Error Running Command:** {}'.format(ctx.message.author.mention,
|
||||||
|
error_str))
|
||||||
|
|
||||||
|
|
||||||
@bot.command()
|
@bot.command()
|
||||||
|
|
Loading…
Reference in New Issue