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
86ea0722
Commit
86ea0722
authored
Nov 12, 2021
by
Trevor Cappallo
Browse files
added logging
parent
32f231c4
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
1 deletion
+6
-1
te4.py
te4.py
+6
-1
No files found.
te4.py
View file @
86ea0722
...
...
@@ -5,6 +5,7 @@ import pprint
import
requests
import
platform
import
random
import
datetime
from
discord.ext
import
tasks
,
commands
from
discord.ext.commands
import
Bot
...
...
@@ -26,11 +27,13 @@ currentGames={}
cnt
=
0
def
parse_server_poll
(
data
):
global
lastData
global
lastData
,
fout
if
data
!=
lastData
:
print
(
data
)
lastData
=
data
with
open
(
'all.log'
,
'a'
)
as
f
:
f
.
write
(
f
"[
{
str
(
datetime
.
datetime
.
now
()).
split
(
'.'
)[
0
]
}
]
{
data
}
\n
"
)
m
=
reSummary
.
match
(
data
)
(
listing
,
summary
)
=
(
m
.
groups
()[
0
],
m
.
groups
()[
1
:])
...
...
@@ -162,6 +165,8 @@ async def status_task():
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
"
)
await
ch
.
send
(
line
)
if
len
(
games
)
==
0
:
...
...
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