add success message, decode http get response
This commit is contained in:
parent
e448a4abb8
commit
964730e758
1 changed files with 3 additions and 2 deletions
|
@ -28,10 +28,11 @@ class Module(ModuleManager.BaseModule):
|
||||||
|
|
||||||
page = utils.http.request(event["args_split"][0])
|
page = utils.http.request(event["args_split"][0])
|
||||||
if page.code == 200:
|
if page.code == 200:
|
||||||
for line in page.data.split("\n"):
|
for line in page.data.decode("utf8").split("\n"):
|
||||||
self._create(event["target"].id, line.strip("\r").split(" "))
|
self._create(event["target"].id, line.strip("\r").split(" "))
|
||||||
|
event["stdout"].write("Log imported")
|
||||||
else:
|
else:
|
||||||
event["stdout"].write("Failed to load log (%d)" % page.code)
|
event["stderr"].write("Failed to load log (%d)" % page.code)
|
||||||
|
|
||||||
def _create(self, channel_id, words):
|
def _create(self, channel_id, words):
|
||||||
words = list(filter(None, words))
|
words = list(filter(None, words))
|
||||||
|
|
Loading…
Reference in a new issue