33 lines
707 B
Python
33 lines
707 B
Python
from itertools import chain
|
|
|
|
|
|
message_content = ""
|
|
images = []
|
|
data = [
|
|
[
|
|
{
|
|
"height": 756,
|
|
"image_key": "img_v3_0277_2c2fbab4-8b13-4a6a-a273-e0d1d47b4ecg",
|
|
"tag": "img",
|
|
"width": 529,
|
|
}
|
|
],
|
|
[
|
|
{"style": [], "tag": "text", "text": "11111111"},
|
|
{"style": [], "tag": "at", "user_id": "@_user_1", "user_name": "官方应用指令"},
|
|
{"style": [], "tag": "text", "text": ""},
|
|
],
|
|
]
|
|
|
|
|
|
for item in chain.from_iterable(data):
|
|
if item.get("tag") == "text":
|
|
message_content += item["text"]
|
|
|
|
if item.get("tag") == "img":
|
|
images.append(item["image_key"])
|
|
|
|
|
|
print(message_content)
|
|
print(images)
|