Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: 消息通道支持飞书自定义机器人 #63

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
x1ah wants to merge 1 commit into srcrs:main
base: main
Choose a base branch
Loading
from x1ah:lark-notify
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
View file Open in desktop
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
View file Open in desktop
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
View file Open in desktop
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)

AltStyle によって変換されたページ (->オリジナル) /