From 0a29cd8fefe840bc9672bf9801d7e46617bab093 Mon Sep 17 00:00:00 2001 From: manetta Date: Wed, 17 Feb 2021 16:53:09 +0100 Subject: [PATCH] pass self to the download function --- LogBot/logbot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index 6039080..df39aa8 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -28,7 +28,7 @@ def write_log(self, message): out.write(html) print('writing to: ', log_path) -def download(message): +def download(self, message): # define media_type if message.url.lower().endswith(('.jpg','jpeg','png','.gif','.bmp','.svg','eps')): media_type = 'images' @@ -125,7 +125,7 @@ logbot @uptime: To check how long @logbot has been around # image / PDF / audio / video if message.url: - media_post, media_type = download(message) + media_post, media_type = download(self, message) if media_post: add_to_db(self, message, media_post=media_post) media_type = media_type.replace('images', 'image') # linguistic hack!