Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"lotteryNum": "抽奖次数(选填,不填请删除此行)",
"woEmail": "沃邮箱俱乐部登陆Url(选填,不填请删除此行)",
"dingtalkWebhook": "钉钉通知 https://oapi.dingtalk.com/robot/send?access_token=xxxx(选填,不填请删除此行)",
"larkWebhook": "飞书自定义机器人通知 https://open.feishu.cn/open-apis/bot/v2/hook/xxx(选填,不填请删除此行)",
"Bark": {
"Barkkey": "(选填,不填请删除 Bark 对象)",
"Barksave": "//是否需要保存推送信息到历史记录,1 为保存,其他值为不保存。(选填,不填请删除 Bark 对象)"
Expand Down
2 changes: 2 additions & 0 deletions index.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,8 @@ def sendNotice(user):
notify.sendIFTTT(user['IFTTT'])
if('Bark' in user) :
notify.sendBark(user['Bark'])
if "larkWebhook" in user:
notify.send_lark(user["larkWebhook"])

#腾讯云函数入口
def main_handler(event, context):
Expand Down
22 changes: 22 additions & 0 deletions notify.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,3 +236,25 @@ def sendBark(Bark):
resp = session.post(url, json = data, headers = headers)
state=json.loads(resp.text)
print(state)


def send_lark(webhook):
"""飞书自定义机器人消息推送"""
content = readFile_text("./log.txt")
data = {
"msg_type": "post",
"content": {
"post": {
"zh_cn": {
"title": "UnicomTask每日报表",
"content": [
[{
"tag": "text",
"text": content
}]
]
}
}
}
}
resp = requests.post(webhook, json=data)