diff --git a/cryptoai/routes/crypto.py b/cryptoai/routes/crypto.py index fcbe1f1..24c8e3e 100644 --- a/cryptoai/routes/crypto.py +++ b/cryptoai/routes/crypto.py @@ -58,9 +58,9 @@ async def get_crypto_kline(symbol: str, timeframe: Optional[str] = None, limit: return result @router.get("/news") -async def get_crypto_news(session: Session = Depends(get_db)): +async def get_crypto_news(page: Optional[int] = 1, limit: Optional[int] = 0, session: Session = Depends(get_db)): - url = 'https://api.blockbeats.cn/h5v1/newsflash/list?page=1&limit=0&ios=1&end_time=&detective=-2' + url = f'https://api.blockbeats.cn/h5v1/newsflash/list?page={page}&limit={limit}&ios=1&end_time=&detective=-2' response = requests.get(url) data = response.json() diff --git a/docker-compose.yml b/docker-compose.yml index 50c80a5..d8543b0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -29,7 +29,7 @@ services: cryptoai-api: build: . container_name: cryptoai-api - image: cryptoai-api:0.2.22 + image: cryptoai-api:0.2.23 restart: always ports: - "8000:8000" diff --git a/test.py b/test.py index 72cca2c..a75bed0 100644 --- a/test.py +++ b/test.py @@ -1,5 +1,19 @@ from cryptoai.agents.crypto_agent import CryptoAgent import cryptoai.tasks.token_selector as token_selector +import telegram +import asyncio + +async def main(): + # token_selector.main() + + #https://t.me/c/2299979359/26 + + chat_id = "2299979359" + + bot = telegram.Bot(token="5671996954:AAH5ymtcEPEnjlkI5ah2I8MemScmX3VF3bY") + + await bot.send_message(chat_id=chat_id, text="Hello, world!") + if __name__ == "__main__": - token_selector.main() \ No newline at end of file + asyncio.run(main()) \ No newline at end of file