Python
4
Вклад в тег
import json
async def downloader_json(update, context):
file = await context.bot.get_file(update.message.document)
downloaded_file = await file.download()
with open('items.json', 'w') as f:
content = await downloaded_file.read()
json.dump(content.decode('utf-8'), f)