mirror of
https://gitlab.com/pancakes1234/wdiscordbotserver.git
synced 2025-06-16 07:14:21 -06:00
Refactor: Send URL of random teto image instead of the image file
This commit is contained in:
parent
5e145f53d6
commit
2f4e8ad721
@ -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)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user