Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
La Quadrature du Net
rpteam
wantzel
Commits
f7ba3600
Commit
f7ba3600
authored
Aug 03, 2019
by
Mindiell
Browse files
Ok, testing return code for API is fixed (3)
parent
5d946fff
Changes
1
Hide whitespace changes
Inline
Side-by-side
rp.py
View file @
f7ba3600
...
...
@@ -355,9 +355,12 @@ class Rp():
Log
.
error
(
"Erreur lors de l'appel à l'API : "
+
str
(
e
))
Log
.
debug
(
result
.
status_code
)
if
result
.
status_code
>=
200
and
result
.
status_code
<
300
:
article
=
json
.
loads
(
result
.
text
)
note
=
article
[
"score"
]
answer
=
True
try
:
article
=
json
.
loads
(
result
.
text
)
note
=
article
[
"score"
]
answer
=
True
except
Exception
as
e
:
Log
.
error
(
"Erreur lors de la récupération de l'article : "
+
str
(
e
))
if
answer
:
# Answer is now based on where, who, note, and a little magic
return
self
.
did_rp
(
channel
,
user
,
note
)
...
...
Write
Preview
Supports
Markdown
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