Spaces:
sahanind
/
No application file

File size: 669 Bytes
d846ab4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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')