whyour / qinglong

支持 Python3、JavaScript、Shell、Typescript 的定时任务管理平台(Timed task management platform supporting Python3, JavaScript, Shell, Typescript)
https://qinglong.online
Apache License 2.0
15.66k stars 2.91k forks source link

通知能否支持VoceChat #2336

Closed roadinger closed 4 months ago

roadinger commented 4 months ago

Clear and concise description of the problem

一些三方通知应用都有频率限制

Suggested solution

希望支持下自建服务VoceChat

Alternative

No response

Additional context

No response

Validations

whyour commented 4 months ago

使用自定义通知,可以实现任何通知

image
roadinger commented 4 months ago

WEBHOOK_CONTENT_TYPE="text/plain" 时WEBHOOK_BODY怎么填?

export WEBHOOK_BODY="$content" 吗?

我就是要通过接口直接发文本消息,不需要消息模版

------------------ 原始邮件 ------------------ 发件人: "whyour/qinglong" @.>; 发送时间: 2024年4月11日(星期四) 晚上9:16 @.>; @.**@.>; 主题: Re: [whyour/qinglong] 通知能否支持VoceChat (Issue #2336)

使用自定义通知,可以实现任何通知 image.png (view on web) — Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

whyour commented 4 months ago

具体你看接口参数,需要设置什么,不需要的话可以为空

roadinger commented 4 months ago

content-type: text/plain 时,消息体无法直接发送 微信截图_20240416101558

roadinger commented 4 months ago

这样不行 01

roadinger commented 4 months ago

具体的参数是这些,我该怎么设置 02

whyour commented 4 months ago

你用的什么脚本,现在返回什么?

whyour commented 4 months ago
image

下面多了,header 只要 x-api-key 就行

roadinger commented 4 months ago

webhookHeaders不添加content-type: text/plain 消息发送报错 加了消息会直接发送 $title $content 03

roadinger commented 4 months ago

04

whyour commented 4 months ago

webhookHeaders不添加content-type: text/plain 消息发送报错 加了消息会直接发送 $title $content 03

不加报什么错

roadinger commented 4 months ago

webhookHeaders不添加content-type: text/plain 消息发送报错 加了消息会直接发送 $title $content 03

不加报什么错

the client request does not include the Content-Type header

whyour commented 4 months ago

webhookHeaders不添加content-type: text/plain 消息发送报错 加了消息会直接发送 $title $content 03

不加报什么错

the client request does not include the Content-Type header

https://github.com/whyour/qinglong/blob/develop/sample/notify.js 用这个最新的通知文件试试

roadinger commented 4 months ago

webhookHeaders不添加content-type: text/plain 消息发送报错 加了消息会直接发送 $title $content 03

不加报什么错

the client request does not include the Content-Type header

https://github.com/whyour/qinglong/blob/develop/sample/notify.js 用这个最新的通知文件试试

修改script目录的sendNotify.js吗

whyour commented 4 months ago

@roadinger 你看你脚本引用的哪个通知文件,就替换哪个

roadinger commented 4 months ago

@roadinger 你看你脚本引用的哪个通知文件,就替换哪个

还是不行 怎么联系你 可以联调下

roadinger commented 4 months ago

@roadinger 你看你脚本引用的哪个通知文件,就替换哪个

formatBodyFun函数是不是也得改下

whyour commented 4 months ago

@roadinger 你看你脚本引用的哪个通知文件,就替换哪个

formatBodyFun函数是不是也得改下

https://github.com/whyour/qinglong/blob/develop/sample/notify.js 修改了

roadinger commented 4 months ago

@roadinger 你看你脚本引用的哪个通知文件,就替换哪个

formatBodyFun函数是不是也得改下

https://github.com/whyour/qinglong/blob/develop/sample/notify.js 修改了

环境变量不能带特殊符号$
WEBHOOK_BODY 不能带$

roadinger commented 4 months ago

export WEBHOOK_BODY="\$title \$content" 这样可以了

whyour commented 4 months ago

@roadinger body 可以用单引号,别用双引号

roadinger commented 4 months ago

@roadinger body 可以用单引号,别用双引号

这样也行,已经解决了