mrrrp (#1250)
This commit is contained in:
@@ -987,55 +987,6 @@ async def test_weekly_br_error(interaction, error):
|
|||||||
await permission_fail(interaction, error)
|
await permission_fail(interaction, error)
|
||||||
|
|
||||||
|
|
||||||
@is_blacklisted()
|
|
||||||
@bot.tree.command(
|
|
||||||
name="resend-weekly-br",
|
|
||||||
description="[DEV] Force-resend the most recently ended Weekly BR Report to all configured channels",
|
|
||||||
)
|
|
||||||
async def resend_weekly_br(interaction: discord.Interaction):
|
|
||||||
"""Clears the idempotency marker and re-dispatches the last BR window."""
|
|
||||||
from .task_executors import execute_weekly_br_report_task, WEEKLY_BR_MARKER_PATH
|
|
||||||
|
|
||||||
await collect_command_stats(interaction)
|
|
||||||
if not await is_dev_team(interaction):
|
|
||||||
await interaction.response.send_message(t("en", "dev.restricted_dev_team"), ephemeral=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
await interaction.response.defer(ephemeral=True)
|
|
||||||
|
|
||||||
window = _pick_test_br_window()
|
|
||||||
if window is None:
|
|
||||||
await interaction.followup.send("Could not pick a BR window from SCHEDULE.json.", ephemeral=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
# Clear the idempotency marker so execute_weekly_br_report_task will proceed.
|
|
||||||
try:
|
|
||||||
WEEKLY_BR_MARKER_PATH.unlink(missing_ok=True)
|
|
||||||
except Exception as e:
|
|
||||||
await interaction.followup.send(f"Failed to clear marker file: {e}", ephemeral=True)
|
|
||||||
return
|
|
||||||
|
|
||||||
start_ts = int(window["start"])
|
|
||||||
end_ts = int(window["end"])
|
|
||||||
await interaction.followup.send(
|
|
||||||
f"Resending **{window['max_br']} BR** window "
|
|
||||||
f"(<t:{start_ts}:D> → <t:{end_ts}:D>) to all configured channels…",
|
|
||||||
ephemeral=True,
|
|
||||||
)
|
|
||||||
|
|
||||||
try:
|
|
||||||
await execute_weekly_br_report_task(window)
|
|
||||||
await interaction.followup.send("✅ Resend complete.", ephemeral=True)
|
|
||||||
except Exception as e:
|
|
||||||
logging.error("[RESEND-WBR] Error: %s", e)
|
|
||||||
await interaction.followup.send(f"❌ Resend failed: {e}", ephemeral=True)
|
|
||||||
|
|
||||||
|
|
||||||
@resend_weekly_br.error
|
|
||||||
async def resend_weekly_br_error(interaction, error):
|
|
||||||
logging.error("[RESEND-WBR] Unhandled error: %s", error)
|
|
||||||
|
|
||||||
|
|
||||||
async def _diagnose_perms_logic(interaction: discord.Interaction, target_channel=None):
|
async def _diagnose_perms_logic(interaction: discord.Interaction, target_channel=None):
|
||||||
"""Core logic for autolog diagnostics. Called from the diagnose channel select."""
|
"""Core logic for autolog diagnostics. Called from the diagnose channel select."""
|
||||||
await interaction.response.defer(ephemeral=True)
|
await interaction.response.defer(ephemeral=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user