This commit is contained in:
NotSoToothless
2026-06-17 00:32:30 -07:00
committed by GitHub
parent d07afdee21
commit 7bd8a1b72c
10 changed files with 808 additions and 32 deletions
+25 -1
View File
@@ -150,6 +150,29 @@ class TssCommands(commands.Cog):
f"✅ Logging **{name}**'s matches to <#{interaction.channel_id}>.", ephemeral=True
)
# ── /log-player ────────────────────────────────────────────────────────
@app_commands.command(name="log-player", description="Send a player's matches to this channel")
@app_commands.describe(player="Player username")
@app_commands.autocomplete(player=player_autocomplete)
@app_commands.checks.has_permissions(manage_guild=True)
@not_blacklisted()
async def log_player(self, interaction: discord.Interaction, player: str):
await interaction.response.defer(ephemeral=True)
if interaction.guild_id is None or interaction.channel_id is None:
return await interaction.followup.send("This command must be used in a server channel.", ephemeral=True)
candidates = await storage.resolve_players(player)
if not candidates:
return await interaction.followup.send(f"No players found matching **{player}**.", ephemeral=True)
if len(candidates) > 1:
return await interaction.followup.send(_too_many_msg(candidates), ephemeral=True)
uid, nick = str(candidates[0]["uid"]), candidates[0]["nick"]
preferences.upsert_log_entry(
interaction.guild_id, uid, "tss-player", nick, interaction.channel_id
)
await interaction.followup.send(
f"✅ Logging **{nick}**'s matches to <#{interaction.channel_id}>.", ephemeral=True
)
# ── /set-player ────────────────────────────────────────────────────────
@app_commands.command(name="set-player", description="Link your Discord account to a War Thunder player")
@app_commands.describe(player="Player username")
@@ -290,7 +313,8 @@ class TssCommands(commands.Cog):
name="Autologging — Manage Server",
value=(
"`/set-team <team>` — set this server's team\n"
"`/log-team <team>` — post a team's matches to this channel"
"`/log-team <team>` — post a team's matches to this channel\n"
"`/log-player <player>` — post a player's matches to this channel"
),
inline=False,
)