Add error handling to 'status' command
parent
0a6853964f
commit
ebc9d65e41
|
@ -118,20 +118,23 @@ if (Access ==1) or (isDM == 1):
|
||||||
else:
|
else:
|
||||||
message = 'Usage "demote <member_name>"'
|
message = 'Usage "demote <member_name>"'
|
||||||
elif text[0] == 'status':
|
elif text[0] == 'status':
|
||||||
record = guild.info(text[1])
|
if len(text) > 1:
|
||||||
if record:
|
record = guild.info(text[1])
|
||||||
if len(text)==3:
|
if record:
|
||||||
if guild.change_status(text[1],text[2]):
|
if len(text)==3:
|
||||||
record = guild.info(text[1]) #refresh record
|
if guild.change_status(text[1],text[2]):
|
||||||
message = '%s now has status of %s' %(text[1], record['Status'])
|
record = guild.info(text[1]) #refresh record
|
||||||
|
message = '%s now has status of %s' %(text[1], record['Status'])
|
||||||
|
else:
|
||||||
|
status = ', '.join(guild.status)
|
||||||
|
message = '%s is not a valid status, valid values are %s.' %(text[2],status)
|
||||||
else:
|
else:
|
||||||
status = ', '.join(guild.status)
|
status = ', '.join(guild.status)
|
||||||
message = '%s is not a valid status, valid values are %s.' %(text[2],status)
|
message = 'Current status for %s is %s.\nTo change use "status %s <status>" where status is one of %s.' %(text[1],record['Status'],text[1],status)
|
||||||
else:
|
else:
|
||||||
status = ', '.join(guild.status)
|
message = '%s is not a member' %text[1]
|
||||||
message = 'Current status for %s is %s.\nTo change use "status %s <status>" where status is one of %s.' %(text[1],record['Status'],text[1],status)
|
|
||||||
else:
|
else:
|
||||||
message = '%s is not a member' %text[1]
|
message = "Say status <member> to query the member's status."
|
||||||
elif text[0] == 'add' and isDM:
|
elif text[0] == 'add' and isDM:
|
||||||
if len(text)==2:
|
if len(text)==2:
|
||||||
if log.info(text[1]):
|
if log.info(text[1]):
|
||||||
|
|
Loading…
Reference in New Issue