fix: Correct variable naming for image path retrieval in Teto image command
This commit is contained in:
parent
fb2e360d8c
commit
3844f2e5d0
@ -17,14 +17,14 @@ class TetoImageCog(commands.Cog):
|
||||
headers = {'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36'}
|
||||
async with session.get(self.teto_url, headers=headers, allow_redirects=False) as response:
|
||||
if response.status == 302:
|
||||
image_url = response.headers.get('Location')
|
||||
if image_url:
|
||||
image_path = response.headers.get('Location')
|
||||
if image_path:
|
||||
image_url = f"https://slipstreamm.dev{image_path}"
|
||||
embed = discord.Embed(
|
||||
title="Random Teto Image",
|
||||
description=f"Website: {self.footer_url}",
|
||||
color=discord.Color.red()
|
||||
)
|
||||
print(f"Image URL: {image_url}") # Debugging line
|
||||
if image_url.startswith("http") or image_url.startswith("https"):
|
||||
embed.set_image(url=image_url)
|
||||
embed.set_footer(text="Random Teto Image Website", icon_url=None)
|
||||
|
Loading…
x
Reference in New Issue
Block a user