diff --git a/bots/scheduler.py b/bots/scheduler.py index 41fa7d3..065fae8 100644 --- a/bots/scheduler.py +++ b/bots/scheduler.py @@ -608,8 +608,19 @@ async def cmd_collect(update: Update, context: ContextTypes.DEFAULT_TYPE): await loop.run_in_executor(None, job_collector) topics_dir = DATA_DIR / 'topics' today = datetime.now().strftime('%Y%m%d') - count = len(list(topics_dir.glob(f'{today}_*.json'))) - await update.message.reply_text(f"✅ 수집 완료! 오늘 글감: {count}개\n/topics 로 확인하세요.") + files = sorted(topics_dir.glob(f'{today}_*.json')) + if not files: + await update.message.reply_text("✅ 수집 완료! 오늘 수집된 글감이 없습니다.") + return + lines = [f"✅ 수집 완료! 오늘 글감 {len(files)}개:"] + for i, f in enumerate(files[:15], 1): + try: + data = json.loads(f.read_text(encoding='utf-8')) + lines.append(f" {i}. [{data.get('corner','')}] {data.get('topic','')[:50]}") + except Exception: + pass + lines.append("\n✍️ /write [번호] 로 글 작성") + await update.message.reply_text('\n'.join(lines)) except Exception as e: await update.message.reply_text(f"❌ 수집 오류: {e}") @@ -668,12 +679,13 @@ async def cmd_show_topics(update: Update, context: ContextTypes.DEFAULT_TYPE): await update.message.reply_text("오늘 수집된 글감이 없습니다.") return lines = [f"📋 오늘 수집된 글감 ({len(files)}개):"] - for f in files[:10]: + for i, f in enumerate(files[:15], 1): try: data = json.loads(f.read_text(encoding='utf-8')) - lines.append(f" [{data.get('quality_score',0)}점][{data.get('corner','')}] {data.get('topic','')[:50]}") + lines.append(f" {i}. [{data.get('quality_score',0)}점][{data.get('corner','')}] {data.get('topic','')[:50]}") except Exception: pass + lines.append("\n✍️ /write [번호] 로 글 작성") await update.message.reply_text('\n'.join(lines))