This commit is contained in:
Slipstream 2025-05-13 10:53:26 -06:00
parent 3c95470f55
commit dd17165336
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -125,9 +125,30 @@ async def owoify_context_menu(interaction: discord.Interaction, message: discord
except discord.HTTPException as e:
await interaction.response.send_message(f"Oopsie! A tiny ewwow occuwwed: {e} >w<", ephemeral=True)
@app_commands.context_menu(name="Owoify Message (AI)")
async def owoify_context_menu_ai(interaction: discord.Interaction, message: discord.Message):
"""Owoifies the content of the selected message using AI and replies."""
if not message.content:
await interaction.response.send_message("The sewected message has no text content to owoify! >.<", ephemeral=True)
return
original_content = message.content
try:
owo_text = await _owoify_text_ai(original_content)
await message.reply(owo_text)
await interaction.response.send_message("Message AI-owoified and wepwied! uwu", ephemeral=True)
except discord.Forbidden:
await interaction.response.send_message(
f"I couwdn't wepwy to the message (nyi Pwermissions? owo).\n"
f"But hewe's the AI owoified text fow you: {owo_text}",
ephemeral=True
)
except Exception as e:
await interaction.response.send_message(f"AI owoification failed: {e} >w<", ephemeral=True)
async def setup(bot: commands.Bot):
cog = OwoifyCog(bot)
await bot.add_cog(cog)
# Add the context menu command to the tree
# Add the context menu commands to the tree
bot.tree.add_command(owoify_context_menu)
bot.tree.add_command(owoify_context_menu_ai)
print("OwoifyCog woaded! uwu")