1
0
Fork 0
mirror of synced 2024-05-18 19:42:28 +12:00

Handle key errors in welcome/goodbye messages

This commit is contained in:
phxntxm 2017-11-28 17:38:41 -06:00
parent 4312b5f5ef
commit b19d080232

View file

@ -860,6 +860,12 @@ class Administration:
if msg and re.search("{.*token.*}", msg):
await ctx.send("Illegal content in {} message".format(parent))
else:
try:
test_keys = msg.format(member='test', server='test')
except KeyError:
await ctx.send("Illegal keyword in {0} message. Please use `{1.prefix}help welcome message` "
"for what keywords can be used".format(parent, ctx))
return
entry = {
'server_id': str(ctx.message.guild.id),
parent + '_message': msg