pass self to the download function

This commit is contained in:
manetta 2021-02-17 16:53:09 +01:00
parent 22944ec0c8
commit 0a29cd8fef

View File

@ -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!