1fc2beff by Barry

Fixed a shitty bug that filled the HD of the host machine..

1 parent 040215f3
...@@ -22,10 +22,6 @@ muted_until = datetime.datetime.now() ...@@ -22,10 +22,6 @@ muted_until = datetime.datetime.now()
22 22
23 client = discord.Client() 23 client = discord.Client()
24 24
25 json_data=open(credentials).read()
26 creds = json.loads(json_data)
27 client.login(creds['username'], creds['password'])
28
29 def leaders(xs, top=20): 25 def leaders(xs, top=20):
30 counts = defaultdict(int) 26 counts = defaultdict(int)
31 for x in xs: 27 for x in xs:
...@@ -615,8 +611,14 @@ def on_ready(): ...@@ -615,8 +611,14 @@ def on_ready():
615 print(client.user.id) 611 print(client.user.id)
616 print('------') 612 print('------')
617 613
618 while 1: 614 retries = 0
615 while retries < 1000:
619 try: 616 try:
617 json_data=open(credentials).read()
618 creds = json.loads(json_data)
619 client.login(creds['username'], creds['password'])
620
620 client.run() 621 client.run()
621 except: 622 except:
622 print("Shit I crashed") 623 retries += 1
624 print("Shit I crashed: Retry %s" % (retries,))
......