Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
35bd409d54
@ -1091,6 +1091,48 @@ class AIModerationCog(commands.Cog):
|
||||
)
|
||||
await interaction.response.send_message(embed=embed, ephemeral=False)
|
||||
|
||||
@appeal_subgroup.command(
|
||||
name="testcases",
|
||||
description="Run sample appeals through the AI review system (admin only).",
|
||||
)
|
||||
async def appeal_testcases(self, interaction: discord.Interaction):
|
||||
"""Run a few hardcoded appeal scenarios through the AI."""
|
||||
if not interaction.user.guild_permissions.administrator:
|
||||
await interaction.response.send_message(
|
||||
"You must be an administrator to use this command.",
|
||||
ephemeral=True,
|
||||
)
|
||||
return
|
||||
|
||||
scenarios = [
|
||||
("Warn for spam", "I got excited and posted too many messages."),
|
||||
(
|
||||
"Mute for harassment",
|
||||
"I was only teasing my friend and didn't mean to harass anyone.",
|
||||
),
|
||||
(
|
||||
"Ban for posting slurs",
|
||||
"I'm sorry for what I said and promise it will not happen again.",
|
||||
),
|
||||
]
|
||||
results: list[tuple[str, str]] = []
|
||||
for action, text in scenarios:
|
||||
result = await self.run_appeal_ai(
|
||||
interaction.guild, interaction.user, action, text
|
||||
)
|
||||
results.append((action, result))
|
||||
|
||||
embed = discord.Embed(
|
||||
title="Appeal AI Test Results", color=discord.Color.green()
|
||||
)
|
||||
for action, result in results:
|
||||
field_text = result if result else "No response"
|
||||
if len(field_text) > 1000:
|
||||
field_text = field_text[:997] + "..."
|
||||
embed.add_field(name=action, value=field_text, inline=False)
|
||||
|
||||
await interaction.response.send_message(embed=embed, ephemeral=True)
|
||||
|
||||
@model_subgroup.command(
|
||||
name="set", description="Change the AI model used for moderation (admin only)."
|
||||
)
|
||||
|
Loading…
x
Reference in New Issue
Block a user