Commit c03b46c8 authored by Trevor Cappallo's avatar Trevor Cappallo
Browse files

hopefully fixed the unsigned rep int

parent 36894e21
......@@ -65,7 +65,7 @@ def parse_server_poll(data):
'score': a[8],
'other_elo': int(a[9], 16),
'give_up_rate': int(a[10], 16),
'reputation': int(a[11], 16),
'reputation': (lambda x: x if x < (1<<31) else (x-(1<<32)))(int(a[11],16)),
'creation_time': int(a[12], 16),
} for a in m],
'summary': summary}
......@@ -165,35 +165,36 @@ async def status_task():
if len(recentlySaid) > 5:
recentlySaid = recentlySaid[-5:]
for line in out:
pprint.pprint(line)
with open('all.log', 'a') as f:
f.write(f"[{str(datetime.datetime.now()).split('.')[0]}] > {pprint.pformat(line)}\n")
myMessages.append((line, await ch.send(line)))
# removed = False
# if ") wants to play a " in line:
# pName = line.split("**")[1]
# for i in range(len(myMessages)-2,max(len(myMessages)-50,1),-1):
# if pName in myMessages[i][0]:
# if ") wants to play a " in myMessages[i][0]:
# # s = f'~~{myMessages[i][0]}~~'
# pprint.pprint(myMessages[i])
# with open('all.log', 'a') as f:
# f.write(f"[{str(datetime.datetime.now()).split('.')[0]}] x {pprint.pformat(myMessages[i][0])}\n")
# await myMessages[i][1].delete()
# myMessages.pop(i)
# removed = True
# break
if cnt>0:
for line in out:
pprint.pprint(line)
with open('all.log', 'a') as f:
f.write(f"[{str(datetime.datetime.now()).split('.')[0]}] > {pprint.pformat(line)}\n")
myMessages.append((line, await ch.send(line)))
# removed = False
# if ") wants to play a " in line:
# pName = line.split("**")[1]
# for i in range(len(myMessages)-2,max(len(myMessages)-50,1),-1):
# if pName in myMessages[i][0]:
# if ") wants to play a " in myMessages[i][0]:
# # s = f'~~{myMessages[i][0]}~~'
# pprint.pprint(myMessages[i])
# with open('all.log', 'a') as f:
# f.write(f"[{str(datetime.datetime.now()).split('.')[0]}] x {pprint.pformat(myMessages[i][0])}\n")
# await myMessages[i][1].delete()
# myMessages.pop(i)
# removed = True
# break
if len(games) == 0:
recentlySaid = []
if len(myMessages) > 100:
myMessages = myMessages[-100:]
if len(games) == 0 and len(recentlySaid) > 1:
recentlySaid = recentlySaid[-1:]
if len(myMessages) > 100:
myMessages = myMessages[-100:]
cnt+=1
bot.run(TOKEN)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment