forked from varia/bots
add lazyloading parameter to only load material which is close to the viewport
This commit is contained in:
parent
f234bafb5c
commit
0369b3f8bc
@ -97,9 +97,9 @@ class Logbot(Bot):
|
||||
# define media_post
|
||||
media_path = os.path.join(media_type, filename)
|
||||
if message.url.lower().endswith(self.IMAGE_TYPES):
|
||||
media_post = f'<img src="{ media_path }">'
|
||||
media_post = f'<img src="{ media_path }" loading="lazy">'
|
||||
elif message.url.lower().endswith(self.FILE_TYPES):
|
||||
media_post = f'<iframe src="{ media_path }"></iframe>'
|
||||
media_post = f'<iframe src="{ media_path }" loading="lazy"></iframe>'
|
||||
elif message.url.lower().endswith(self.AUDIO_TYPES):
|
||||
media_post = f'<audio controls src="{ media_path }"></audio>'
|
||||
elif message.url.lower().endswith(self.VIDEO_TYPES):
|
||||
|
Loading…
Reference in New Issue
Block a user