Discord 장전분석 알림을 morning.py --send-discord로 이동
Headless Claude가 one-liner 실행을 건너뛰고 텍스트만 출력하는 문제 수정. daily_context.json을 읽어 전송하는 send_discord() 함수를 morning.py에 추가. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -46,22 +46,9 @@ python app/ai/morning.py --print
|
||||
```
|
||||
|
||||
### 4. Discord 알림 전송
|
||||
아래 Python 코드를 실행해 분석 결과를 Discord로 전송한다:
|
||||
아래 명령을 실행해 분석 결과를 Discord로 전송한다:
|
||||
```bash
|
||||
python -c "
|
||||
import asyncio, json, os, sys
|
||||
sys.path.insert(0, '.')
|
||||
from app.main import load_env; load_env()
|
||||
from app.monitor.notifier import send
|
||||
ctx = json.load(open('data/daily_context.json', encoding='utf-8'))
|
||||
hot = ', '.join(ctx.get('hot_sectors', [])) or '없음'
|
||||
avoid = ', '.join(ctx.get('avoid_sectors', [])) or '없음'
|
||||
boosted = ', '.join(ctx.get('boosted_tickers', [])) or '없음'
|
||||
flag = '✅ 거래허용' if ctx.get('trade_allowed', True) else '🚫 거래중단'
|
||||
msg = f'[장전분석] {ctx[\"date\"]} {ctx.get(\"generated_at\",\"\")}\n시장: {ctx[\"market_sentiment\"]}({ctx[\"sentiment_score\"]}점) | 리스크: {ctx[\"risk_level\"]} | {flag}\n주목 섹터: {hot}\n회피 섹터: {avoid}\n관심 종목: {boosted}\n비중 배율: x{ctx.get(\"position_size_multiplier\",1.0)}\n📝 {ctx.get(\"reason\",\"\")}'
|
||||
asyncio.run(send(msg))
|
||||
print('Discord 전송 완료')
|
||||
"
|
||||
python app/ai/morning.py --send-discord
|
||||
```
|
||||
|
||||
### 5. 완료
|
||||
|
||||
Reference in New Issue
Block a user