Add game channel redirect feature and sexual_vulgar detection
Detect when users discuss a game in the wrong channel (e.g. GTA talk in #warzone) and send a friendly redirect to the correct channel. Also add sexual_vulgar category and scoring rules so crude sexual remarks directed at someone aren't softened by "lmao". Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -358,8 +358,25 @@ class CommandsCog(commands.Cog):
|
||||
|
||||
await interaction.response.defer(ephemeral=True)
|
||||
|
||||
# Build channel context for game detection
|
||||
game_channels = self.bot.config.get("game_channels", {})
|
||||
channel_context = ""
|
||||
if game_channels and hasattr(interaction.channel, "name"):
|
||||
ch_name = interaction.channel.name
|
||||
current_game = game_channels.get(ch_name)
|
||||
lines = []
|
||||
if current_game:
|
||||
lines.append(f"Current channel: #{ch_name} ({current_game})")
|
||||
else:
|
||||
lines.append(f"Current channel: #{ch_name}")
|
||||
channel_list = ", ".join(f"#{ch} ({g})" for ch, g in game_channels.items())
|
||||
lines.append(f"Game channels: {channel_list}")
|
||||
channel_context = "\n".join(lines)
|
||||
|
||||
user_notes = self.bot.drama_tracker.get_user_notes(interaction.user.id)
|
||||
raw, parsed = await self.bot.llm.raw_analyze(message, user_notes=user_notes)
|
||||
raw, parsed = await self.bot.llm.raw_analyze(
|
||||
message, user_notes=user_notes, channel_context=channel_context,
|
||||
)
|
||||
|
||||
embed = discord.Embed(
|
||||
title="BCS Test Analysis", color=discord.Color.blue()
|
||||
@@ -389,6 +406,14 @@ class CommandsCog(commands.Cog):
|
||||
value=parsed["reasoning"][:1024] or "n/a",
|
||||
inline=False,
|
||||
)
|
||||
detected_game = parsed.get("detected_game")
|
||||
if detected_game:
|
||||
game_label = game_channels.get(detected_game, detected_game)
|
||||
embed.add_field(
|
||||
name="Detected Game",
|
||||
value=f"#{detected_game} ({game_label})",
|
||||
inline=True,
|
||||
)
|
||||
else:
|
||||
embed.add_field(
|
||||
name="Parsing", value="Failed to parse response", inline=False
|
||||
|
||||
Reference in New Issue
Block a user