🐛 修复gsrc中的wx问题

This commit is contained in:
Wuyi无疑 2023-04-11 10:41:25 +08:00 committed by GitHub
parent 1b8e77587c
commit 857d02f2e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -137,9 +137,7 @@ async def topup_(
item_icon_url = goods_data['goods_icon'] # 图标 item_icon_url = goods_data['goods_icon'] # 图标
item_id = goods_data['goods_id'] # 商品内部id item_id = goods_data['goods_id'] # 商品内部id
item_pay_url = order['encode_order'] # 支付链接 item_pay_url = order['encode_order'] # 支付链接
item_name_full = ( item_name_full = f"{goods_data['goods_name']}×{goods_data['goods_unit']}"
f"{goods_data['goods_name']}×{goods_data['goods_unit']}"
)
# 物品名字(非月卡) # 物品名字(非月卡)
item_name = ( item_name = (
item_name_full item_name_full
@ -147,9 +145,7 @@ async def topup_(
else goods_data["goods_name"] else goods_data["goods_name"]
) )
# 物品名字 # 物品名字
item_price: str = order["currency"] + str( item_price: str = order["currency"] + str(int(order["amount"]) / 100) # 价格
int(order["amount"]) / 100
) # 价格
item_order_no = order['order_no'] # 订单号 item_order_no = order['order_no'] # 订单号
item_create_time = order['create_time'] # 创建时间 item_create_time = order['create_time'] # 创建时间
timestamp = strftime( timestamp = strftime(
@ -182,8 +178,8 @@ async def topup_(
msg_text = f'{item_name}\nUID: {uid}\n时间: {timestamp}' msg_text = f'{item_name}\nUID: {uid}\n时间: {timestamp}'
msg_text2 = msg_text + f'\n\n{item_pay_url}\n\n{disnote}' msg_text2 = msg_text + f'\n\n{item_pay_url}\n\n{disnote}'
msg_node = [] msg_node = []
msg_node.append(Message('text', msg_text2)) msg_node.append(MessageSegment.text(msg_text2))
msg_node.append(Message('image', img_data)) msg_node.append(MessageSegment.image(img_data))
await bot.send(MessageSegment.node(msg_node)) await bot.send(MessageSegment.node(msg_node))
except Exception: except Exception:
traceback.print_exc() traceback.print_exc()