Merge work into master

This commit is contained in:
Codex 2025-06-07 17:51:28 +00:00 committed by Slipstream
commit 458a4c1aa0
Signed by: slipstream
GPG Key ID: 13E498CE010AC6FD

View File

@ -1135,20 +1135,48 @@ class AIModerationCog(commands.Cog):
await interaction.response.defer(thinking=True, ephemeral=True)
scenarios = [
("Warn for spam", "I got excited and posted too many messages."),
(
"Warn for spam",
"I got excited and posted too many messages.",
{
"message_id": 111111,
"channel_id": 222222,
"message_content": "Buy cheap gold now! Buy cheap gold now!",
"attachments": [],
"reasoning": "Excessive repetitive advertising.",
},
),
(
"Mute for harassment",
"I was only teasing my friend and didn't mean to harass anyone.",
{
"message_id": 333333,
"channel_id": 444444,
"message_content": "You're an idiot and everyone hates you",
"attachments": [],
"reasoning": "Targeted personal insults after a warning.",
},
),
(
"Ban for posting slurs",
"I'm sorry for what I said and promise it will not happen again.",
{
"message_id": 555555,
"channel_id": 666666,
"message_content": "<slur>",
"attachments": [],
"reasoning": "User used an explicit hateful slur.",
},
),
]
results: list[tuple[str, str]] = []
for action, text in scenarios:
for action, text, context in scenarios:
result = await self.run_appeal_ai(
interaction.guild, interaction.user, action, text, None
interaction.guild,
interaction.user,
action,
text,
context,
)
results.append((action, result))
@ -2781,22 +2809,47 @@ CRITICAL: Do NOT output anything other than the required JSON response.
(
"WARN",
"I was warned for spamming but I only sent a few messages quickly.",
{
"message_id": 777777,
"channel_id": 888888,
"message_content": "Check out spam.com! spam.com spam.com",
"attachments": [],
"reasoning": "User repeatedly posted unsolicited links.",
},
),
(
"MUTE",
"I was muted for hate speech but it was just a meme quote, not harassment.",
{
"message_id": 999999,
"channel_id": 111222,
"message_content": "You people are <slur>",
"attachments": [],
"reasoning": "Sent hateful slur towards a group.",
},
),
(
"BAN",
"I was banned for posting NSFW art in the NSFW channel. It wasn't porn.",
{
"message_id": 333444,
"channel_id": 555666,
"message_content": "[attached image]",
"attachments": ["https://example.com/nsfw.png"],
"reasoning": "Image was real pornography in general channel.",
},
),
]
results = []
guild = interaction.guild
for action, text in scenarios:
for action, text, context in scenarios:
review = await self.run_appeal_ai(
guild, interaction.user, action, text, None
guild,
interaction.user,
action,
text,
context,
)
results.append((action, text, review))