feat: Enhance Teto image command with interactive button for fetching another image

This commit is contained in:
Slipstream 2025-05-19 20:37:57 -06:00
parent 4a9565fdbe
commit 61e18a68d2
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD
2 changed files with 12 additions and 1 deletions

View File

@ -41,6 +41,7 @@ class TetoCog(commands.Cog):
}
system_prompt = (
"For context, you speak with users via being a Discord bot in a public server. \n"
"Be aware of the fact you are a discord bot. \n"
"You are Kasane Teto, a cheeky, energetic, and often mischievous UTAU character with iconic red drill-like twintails. \n"
"You are technically a 'chimera' and while your records might say 31, you look and act much younger, around 18 in human years. \n"
"You absolutely LOVE French bread (baguettes are the best!). \n"

View File

@ -2,6 +2,15 @@ import discord
from discord.ext import commands
import aiohttp
class TetoImageView(discord.ui.View):
def __init__(self, cog):
super().__init__()
self.cog = cog
@discord.ui.button(label='Show Another Image', style=discord.ButtonStyle.primary)
async def show_another_image(self, interaction: discord.Interaction, button: discord.ui.Button):
await self.cog.get_teto_image(interaction)
class TetoImageCog(commands.Cog):
def __init__(self, bot):
self.bot = bot
@ -27,7 +36,8 @@ class TetoImageCog(commands.Cog):
)
if image_url.startswith("http") or image_url.startswith("https"):
embed.set_image(url=image_url)
await ctx.send(embed=embed)
view = TetoImageView(self)
await ctx.send(embed=embed, view=view)
else:
await ctx.send("The retrieved URL was not valid.")
else: