feat(douyu): 兑换成功后生成结果图片并自动复制到剪贴板
- 账号表格新增兑换图片列,展示每账号最近兑换成功的结果卡片 - 新完成兑换任务自动生成图片并复制到剪贴板(批量时最后完成者覆盖) - canvas 绘制兑换卡片:商品图/商品名/游戏角色/区服/兑换账号/时间 - 后端兑换成功结果补充 game_name/game_channel/account_name 字段 - 不支持剪贴板的环境降级为点击查看大图
This commit is contained in:
@@ -1835,7 +1835,13 @@ class DouyuBatchRunner:
|
||||
task,
|
||||
"success",
|
||||
f"兑换成功: {(goods.name if goods else '') or commodity_id}",
|
||||
{"goods": goods.raw if goods else None, **result},
|
||||
{
|
||||
"goods": goods.raw if goods else None,
|
||||
"game_name": account.game_name or "",
|
||||
"game_channel": account.game_channel or "",
|
||||
"account_name": account.nickname or account.username or account.uid or f"#{account.id}",
|
||||
**result,
|
||||
},
|
||||
)
|
||||
|
||||
def _execute_exchange_esports_goods(
|
||||
@@ -1901,6 +1907,9 @@ class DouyuBatchRunner:
|
||||
message += f" x{quantity}"
|
||||
if account.esports_points is not None:
|
||||
message += f",电竞积分: {account.esports_points}"
|
||||
result["game_name"] = account.esports_game_name or ""
|
||||
result["game_channel"] = account.esports_game_channel or ""
|
||||
result["account_name"] = account.nickname or account.username or account.uid or f"#{account.id}"
|
||||
self._mark_task(db, task, "success", message, result)
|
||||
|
||||
def _execute_query_game_name(self, db: Session, task: DouyuTask, account: Account, cookie: str, config: dict):
|
||||
|
||||
Reference in New Issue
Block a user