From 051402c1dec74809412fddf4eade4199740b375c Mon Sep 17 00:00:00 2001 From: Purpur <43528123+Pemigrade@users.noreply.github.com> Date: Sat, 26 Dec 2020 09:19:44 -0600 Subject: [PATCH] Remove commented out chunks that I probably won't use --- bot.py | 38 -------------------------------------- 1 file changed, 38 deletions(-) diff --git a/bot.py b/bot.py index aa1dbea..5780e6e 100644 --- a/bot.py +++ b/bot.py @@ -149,26 +149,6 @@ async def on_message(message): elif discord_id_already_exists: await channel.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'])) - - # Makes json pretty with indentations and stuff, then writes to file -# json_dumps = json.dumps(json_response, indent = 2) -# file = open("data.json", "w") -# file.write(json_dumps) -# file.close() - -# linked_servers = {} -# linked_servers['server'] = [] -# for server in json_response['data']: -# server_owner = server['attributes']['server_owner'] -# server_uuid = server['attributes']['uuid'] -# server_name = server['attributes']['name'] -# server_node = server['attributes']['node'] -# message_sender = message.author.id -# info = str(server_owner) + server_uuid + server_name + server_node + str(message_sender) -# logging.info(info) -# file = open('/home/container/data/' + str(message.author.id) + '.json', "a") -# file.write(info + '\n') -# file.close() else: #Says if API key is the corect # of characters but invalid await channel.send("Sorry, that appears to be an invalid API key.") @@ -323,24 +303,6 @@ async def updater(): await member.edit(roles=[]) 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) - # file.close() - # Checks if user exists. If so, skips adding them to users.json -# already_exists = False -# for olduser in olddata['users']: -# if olduser['discord_id'] == json_response['attributes']['id']: -# -# if already_exists == False: -# olddata['users'].append({ -# 'discord_id': message.author.id, -# 'client_id': json_response['attributes']['id'], -# 'client_api_key': message.content -# }) -# json_dumps = json.dumps(olddata, indent = 2) -# file = open('oldusers.json', 'w') -# file.write(json_dumps) -# file.close() data['users'].pop(i) json_dumps = json.dumps(data, indent = 2) file = open('users.json', 'w')