Spaces:
sahanind
/
No application file

simplz / bdl.py
sahanind's picture
Create bdl.py
d846ab4 verified
raw
history blame
669 Bytes
from FastTelethonhelper import fast_download
from FastTelethonhelper import fast_upload
from telethon import TelegramClient, events,sync
import asyncio
async def downdb():
client = TelegramClient(None, api_id, api_hash)
await client.start(bot_token=bot_token)
os.remove('instance/database.db')
@client.on(events.NewMessage)
async def handler(event):
last_message = event.message
await fast_download(client,last_message)
await asyncio.sleep(10)
await client.disconnect()
return '2'
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
rp = loop.run_until_complete(downdb())
print('done')