1 Star 2 Fork 4

ARCTURUS/bilibili

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
tools.py 2.62 KB
一键复制 编辑 原始数据 按行查看 历史
ARCTURUS 提交于 2023-04-14 14:47 . feat: Update code
def handler(fn):
def inner(*args, **kwargs):
res = fn(*args, **kwargs)
content = [
{
"h4": {
"content": res["name"],
},
},
{
"txt": {
"content": f"等级: {res['level']}",
},
},
{
"txt": {
"content": f"硬币: {res['coin']}",
},
},
{
"txt": {
"content": f"经验: {res['exp']}",
},
},
]
watch = res.get("watch")
if watch is not None:
content.append(
{
"txt": {
"content": watch,
}
}
)
share = res.get("share")
if share is not None:
content.append(
{
"txt": {
"content": f"分享视频: {share}",
}
}
)
coins = res.get("coins")
if coins is not None:
content.append(
{
"h5": {
"content": "投币",
},
"orderedList": {
"content": coins,
},
}
)
comics = res.get("comics")
if comics is not None:
content.extend(
[
{
"h5": {
"content": "漫画签到",
},
"txt": {
"content": f"连续签到 {comics} 天",
},
},
]
)
lb = res.get("lb")
if lb is not None:
content.extend(
[
{
"h5": {
"content": "直播",
},
"txt": {
"content": lb["raward"],
},
},
]
)
toCoin = res.get("toCoin")
if toCoin is not None:
content.append(
{
"h5": {
"content": "银瓜子兑换硬币",
},
"txt": {
"content": toCoin,
},
}
)
return content
return inner
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
Python
1
https://gitee.com/ICE99125/bilibili.git
git@gitee.com:ICE99125/bilibili.git
ICE99125
bilibili
bilibili
main

搜索帮助