Browse Source

pass self to the download function

master
manetta 10 months ago
parent
commit
0a29cd8fef
  1. 4
      LogBot/logbot.py

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

Loading…
Cancel
Save