MetaTrader5-Docker-Goldex/check_channel_ids.sh

19 lines
563 B
Bash
Raw Permalink Normal View History

2026-11-10 19:53:44 +00:00
export $(grep '^API_\|^CHANNEL' bots.env | xargs)
docker compose run --rm \
-e API_ID=$API_ID \
-e API_HASH=$API_HASH \
live-trader python -c "
import asyncio
from telethon import TelegramClient
import os
async def main():
async with TelegramClient('/data/mysession', int(os.environ['API_ID']), os.environ['API_HASH']) as client:
async for dialog in client.iter_dialogs():
if any(x in dialog.name.lower() for x in ['hm', 'gold', 'xau', 'vip']):
print(f'ID: {dialog.id} Name: {dialog.name}')
asyncio.run(main())
"