'Your Discord account has been linked to your panel account! You may unlink your Discord and panel accounts by reacting in the #verification channel or by deleting your Verification API key.')
logging.info("Success message sent to "+message.author.name+"#"+str(
message.author.discriminator)+" ("+str(
message.author.id)+")"+". User linked to API key "+message.content+" and client_id "+str(
json_response['attributes']['id']))
elifdiscord_id_already_exists:
awaitchannel.send(
'Sorry, your Discord account is already linked to a panel account. If you would like to link your Discord account to a different panel account, please unlink your Discord account first by reacting in the #verification channel.')
logging.info("Duplicate Discord message sent to "+message.author.name+"#"+str(
message.author.discriminator)+" ("+str(
message.author.id)+")"+" for using API key "+message.content+" linked to client_id "+str(
json_response['attributes']['id']))
elifclient_id_already_exists:
awaitchannel.send(
'Sorry, your panel account is already linked to a Discord account. If you would like to link your panel account to a different Discord account, please unlink your panel account first by deleting its Verification API key and waiting up to 10 minutes.')
logging.info("Duplicate panel message sent to "+message.author.name+"#"+str(
message.author.discriminator)+" ("+str(
message.author.id)+")"+" for using API key "+message.content+" linked to client_id "+str(
json_response['attributes']['id']))
else:
# Says if API key is the corect # of characters but invalid
awaitchannel.send("Sorry, that appears to be an invalid API key.")
logging.info(
'invalid sent to '+message.author.name+"#"+str(message.author.discriminator)+" ("+str(
message.author.id)+")")
else:
data['users'].pop(i)
json_dumps=json.dumps(data,indent=2)
file=open('users.json','w')
file.write(json_dumps)
file.close()
logging.info("removed discord_id "+str(client['discord_id'])+" with client_id "+str(
client['client_id'])+" and client_api_key "+client['client_api_key'])
@linking_updater.before_loop
asyncdefbefore_linking_updater(self):
logging.info('waiting to enter loop')
awaitbot.wait_until_ready()
# Says this if API key is incorrect # of characters
awaitchannel.send(
'Sorry, that doesn\'t appear to be an API token. An API token should be a long string resembling this: ```yQSB12ik6YRcmE4d8tIEj5gkQqDs6jQuZwVOo4ZjSGl28d46```')
logging.info("obvious incorrect sent to "+message.author.name+"#"+str(