Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Trevor Cappallo
TE4bot
Commits
c03b46c8
Commit
c03b46c8
authored
Nov 14, 2021
by
Trevor Cappallo
Browse files
hopefully fixed the unsigned rep int
parent
36894e21
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
26 deletions
+27
-26
te4.py
te4.py
+27
-26
No files found.
te4.py
View file @
c03b46c8
...
...
@@ -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
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment