chore: auto-commit from dashboard

This commit is contained in:
2026-04-02 19:43:01 +00:00
parent d9450ce70d
commit 5fafc29dc1
9 changed files with 383 additions and 20 deletions

View File

@@ -936,8 +936,8 @@ def create_bot(config: Config) -> discord.Client:
@client.event
async def on_message(message: discord.Message) -> None:
# Ignore bot's own messages
if message.author == client.user:
# Ignore messages from any bot (including self)
if message.author.bot:
return
# DM handling: only process if sender is admin

View File

@@ -74,9 +74,11 @@ def main():
if channel is None:
logger.warning("Cron: channel %s not found in Discord cache", channel_id)
return
logger.info("Cron: sending %d chars to channel %s (%s)", len(text), channel_alias, channel_id)
chunks = split_message(text)
for chunk in chunks:
await channel.send(chunk)
logger.info("Cron: sent successfully to %s", channel_alias)
scheduler = Scheduler(send_callback=_send_to_channel, config=config)
client.scheduler = scheduler # type: ignore[attr-defined]

View File

@@ -19,7 +19,7 @@ STATE_FILE = PROJECT_ROOT / "cron" / "newsletter-cercetasi-state.json"
KB_PROMPT_FILE = (
PROJECT_ROOT / "memory" / "kb" / "projects" / "grup-sprijin" / "prompt-newsletter-cercetasi.md"
)
CLAUDE_TIMEOUT = 120
CLAUDE_TIMEOUT = 300
def _read_state() -> dict:

View File

@@ -329,7 +329,9 @@ class Scheduler:
self._save_jobs()
# Send output via callback
if self._send_callback and result_text:
if not result_text:
logger.warning("Job '%s' produced empty result, skipping send", name)
elif self._send_callback:
try:
await self._send_callback(job["channel"], result_text)
except Exception as exc: