import json
json_text = '''{"total":20,"rows":[
{"id":123,"mark":null,"Status":2,"MessageNumber":123456789,"text":"Привет"},
{"id":1234,"mark":null,"Status":1,"MessageNumber":23456789,"text":"Пока"},
{"id":12345,"mark":null,"Status":2,"MessageNumber":345678, "text":"Ало"}]
}'''
data = json.loads(json_text)
numbers = [x["MessageNumber"] for x in data["rows"]]
print (numbers)
with open("output.txt", "w") as f:
print (", ".join(str(x) for x in numbers), file=f)
import requests
import json
data = '203.13.32.122:80\n203.13.32.122:443'
r = requests.post('https://proxy-checker.net/api/proxy-checker/', data={"proxy_list": data })
print (r)
resp_json = r.json()
if isinstance(resp_json, str):
resp_json = json.loads(r.json())
print (json.dumps(resp_json, indent=2, ensure_ascii=False))
status = bot.get_chat_member(chat_id = '-1001670595457', user_id = message.from_user.id).status
if status in ['creator, administrator', 'member']:
...
answer_message_text = ""
for tickers in data2['tickers']:
answer_message_text += f"{tickers['market']['name']} - {tickers['trade_url']}\n")
# а надо ли ещё какие-то массивы использовать?
#market_name.append(tickers['market']['name'])
#market_link.append(tickers['trade_url'])
await message.answer(answer_message_text)