21 lines
590 B
Python
21 lines
590 B
Python
|
|
import asyncio
|
||
|
|
import aiohttp
|
||
|
|
import os
|
||
|
|
from dotenv import load_dotenv
|
||
|
|
|
||
|
|
load_dotenv()
|
||
|
|
|
||
|
|
async def test():
|
||
|
|
url = os.getenv("DISCORD_WEBHOOK_URL")
|
||
|
|
if not url:
|
||
|
|
print("❌ DISCORD_WEBHOOK_URL 이 .env에 없습니다")
|
||
|
|
return
|
||
|
|
async with aiohttp.ClientSession() as s:
|
||
|
|
r = await s.post(url, json={"content": "[테스트] KIS 연결 완료 ✅ 단타봇 준비 중"})
|
||
|
|
if r.status in (200, 204):
|
||
|
|
print("✅ Discord 전송 완료 - 채널 확인하세요")
|
||
|
|
else:
|
||
|
|
print(f"❌ 전송 실패: {r.status}")
|
||
|
|
|
||
|
|
asyncio.run(test())
|