Python
2
Вклад в тег
@bot.message_handler(content_types=["document"])
def handle_docs_audio(message):
document_id = message.document.file_id
file_info = bot.get_file(document_id)
urllib.request.urlretrieve(f'https://api.telegram.org/file/bot{const.token}/{file_info.file_path}', file_info.file_path)
players = []
def start_message(message):
response = requests.get("ссылка на json файл") #json
todos = json.loads(response.text)
for player in todos['data']['data']:
name = player['name']
kills = player['kills']
deaths = player['deaths']
players.append("Name: " + name + "\n" +"Kills: " + kills + "\n" + "Deaths: "+ deaths)
bot.send_message(message.chat.id, players)
a=1
b=1
c=a+b
print(c)