Refactor: Send URL of random teto image instead of the image file

This commit is contained in:
pancakes-proxy 2025-05-19 20:43:52 +09:00
parent 5e145f53d6
commit 2f4e8ad721

View File

@ -2,7 +2,6 @@ import discord
from discord import app_commands
from discord.ext import commands
import aiohttp
import io
class RandomTeto(commands.Cog):
def __init__(self, bot):
@ -15,9 +14,8 @@ class RandomTeto(commands.Cog):
async with aiohttp.ClientSession() as session:
async with session.get(url) as resp:
if resp.status == 200:
img_bytes = await resp.read()
file = discord.File(io.BytesIO(img_bytes), filename="teto.jpg")
await interaction.followup.send(file=file)
# Send the URL instead of the image file
await interaction.followup.send(url)
else:
await interaction.followup.send("Failed to fetch image.", ephemeral=True)