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
43d323bf
Commit
43d323bf
authored
Nov 03, 2021
by
Trevor Cappallo
Browse files
fix spamming score
parent
8dac27ec
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
7 deletions
+6
-7
te4.py
te4.py
+6
-7
No files found.
te4.py
View file @
43d323bf
...
...
@@ -95,10 +95,9 @@ async def status_task():
nix
=
[]
for
game
in
info
[
'games'
]:
if
"..."
not
in
game
[
'score'
]
and
" -- "
not
in
game
[
'score'
]:
if
"..."
not
in
game
[
'score'
]
and
" -- "
not
in
game
[
'score'
]
and
game
[
'name'
]
in
currentGames
.
keys
()
:
out
+=
[
f
"The
{
game
[
'name'
]
}
game is finished. The final score was
{
game
[
'score'
]
}
."
]
if
game
[
'name'
]
in
currentGames
.
keys
():
del
currentGames
[
game
[
'name'
]]
del
currentGames
[
game
[
'name'
]]
for
ongoing
in
currentGames
.
keys
():
if
ongoing
not
in
[
x
[
'name'
]
for
x
in
info
[
'games'
]]:
out
+=
[
f
"The
{
ongoing
}
game is finished. Final score:
{
currentGames
[
ongoing
][
'score'
]
}
"
]
...
...
@@ -106,9 +105,9 @@ async def status_task():
for
xin
in
nix
:
del
currentGames
[
xin
]
if
len
(
newGames
)
>
0
:
if
len
(
newGames
)
>
0
or
len
(
out
)
>
0
:
for
game
in
newGames
:
if
game
[
'ip'
]
==
'0'
:
if
game
[
'ip'
]
==
'0'
and
' -- '
in
game
[
'score'
]
:
if
' vs '
not
in
game
[
'name'
]:
continue
else
:
...
...
@@ -125,9 +124,9 @@ async def status_task():
recentlySaid
.
append
(
s
)
if
len
(
recentlySaid
)
>
5
:
recentlySaid
=
recentlySaid
[
-
5
:]
pprint
.
pprint
(
out
)
if
len
(
out
)
>
0
:
pprint
.
pprint
(
out
)
await
ch
.
send
(
"
\n
"
.
join
(
out
))
oldGames
=
[
sorted
([
str
(
y
)
for
y
in
x
.
values
()])
for
x
in
newGames
]
# oldGames += newGames
...
...
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