awaitchannel.send('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.')
print("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']))
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']))
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.')
print("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']))
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']))
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.')
print("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']))
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']))
# Makes json pretty with indentations and stuff, then writes to file
#Says if API key is the corect # of characters but invalid
awaitchannel.send("Sorry, that appears to be an invalid API key.")
print('invalid sent to '+message.author.name+"#"+str(message.author.discriminator)+" ("+str(message.author.id)+")")
logging.info('invalid sent to '+message.author.name+"#"+str(message.author.discriminator)+" ("+str(message.author.id)+")")
else:
#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```')
print("obvious incorrect sent to "+message.author.name+"#"+str(message.author.discriminator)+" ("+str(message.author.id)+")")
logging.info("obvious incorrect sent to "+message.author.name+"#"+str(message.author.discriminator)+" ("+str(message.author.id)+")")
awaitmember.send("Hey there! It looks like you'd like to verify your account. I'm here to help you with that!\n\nIf you're confused at any point, see https://birdflop.com/verification for a tutorial including images.\n\nWith that said, let's get started! You'll want to start by grabbing some API credentials for your account by signing into https://panel.birdflop.com. Head over to the **Account** section in the top right, then click on the **API Credentials tab**. You'll want to create an API key with description `Verification` and `172.18.0.2` in the **Allowed IPs section**.\n\nWhen you finish entering the necessary information, hit the blue **Create **button.\n\nNext, you'll want to copy your API credentials. After clicking **Create**, you'll receive a long string. Copy it with `ctrl+c` (`cmnd+c` on Mac) or by right-clicking it and selecting **Copy**.\n\nIf you click on the **Close **button before copying the API key, no worries! Delete your API key and create a new one with the same information.\n\nFinally, direct message your API key to Botflop: that's me!\n\nTo verify that you are messaging the key to the correct user, please ensure that the my ID is `Botflop#2403` and that my username is marked with a blue **BOT** badge. Additionally, the only server under the **Mutual Servers** tab should be Birdflop Hosting.\n\nAfter messaging me your API key, you should receive a success message. If you do not receive a success message, please create a ticket in the Birdflop Discord's #support channel.")
print("sent verification challenge to "+member.name+"#"+str(member.discriminator)+" ("+str(member.id)+")")
logging.info("sent verification challenge to "+member.name+"#"+str(member.discriminator)+" ("+str(member.id)+")")
print("removed discord_id "+str(client['discord_id'])+" with client_id "+str(client['client_id'])+" and INVALID client_api_key "+client['client_api_key'])
logging.info("removed discord_id "+str(client['discord_id'])+" with client_id "+str(client['client_id'])+" and INVALID client_api_key "+client['client_api_key'])
else:
# file = open('oldusers.json', 'r')
# olddata = json.load(file)
@ -345,11 +346,11 @@ async def update_servers():
file=open('users.json','w')
file.write(json_dumps)
file.close()
print("removed discord_id "+str(client['discord_id'])+" with client_id "+str(client['client_id'])+" and client_api_key "+client['client_api_key'])
logging.info("removed discord_id "+str(client['discord_id'])+" with client_id "+str(client['client_id'])+" and client_api_key "+client['client_api_key'])