walinejs / waline

💬 A Simple, Safe Comment System
https://waline.js.org/en/
GNU General Public License v2.0
2.31k stars 404 forks source link

[Feature]: 企业微信群聊机器人通知 || [Feature]: Enterprise WeChat group chat robot notification #2661

Open axiaoxin opened 3 months ago

axiaoxin commented 3 months ago

功能概述 | Describe the feature

curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=the-bot-key' \
   -H 'Content-Type: application/json' \
   -d '
   {
        "msgtype": "text",
        "text": {
            "content": "hello world"
        }
   }'

Feature Overview | Describe the feature

curl 'https://qyapi.weixin.qq.com/cgi-bin/webhook/send?key=the-bot-key' \
   -H 'Content-Type: application/json' \
   -d '
   {
        "msgtype": "text",
        "text": {
            "content": "hello world"
        }
   }'
lizheming commented 3 months ago

我们是支持企业微信通知的 https://waline.js.org/guide/features/notification.html#%E4%BC%81%E4%B8%9A%E5%BE%AE%E4%BF%A1%E5%BA%94%E7%94%A8%E9%80%9A%E7%9F%A5

由于企业微信不怎么在外网使用,所以并没有在英文文档中描述。

如果你认为功能有差异,你也可以使用 WEBHOOK 环境变量 https://waline.js.org/reference/server/env.html#%E9%AB%98%E7%BA%A7%E9%85%8D%E7%BD%AE 或者是自己写一个 Waline 插件来实现 https://waline.js.org/reference/server/plugin.html

axiaoxin commented 3 months ago

好的。是有一点功能差异,我目前就是采用的你提到的webhook方式实现的。 确实需求比较小众,我的应用场景是个人身份是有群聊机器人接收通知,个人没有办法认证企业,应该是没有企业ID,群聊机器人则没有限制,server酱的接入链接也没法打开,所以提了这个功能请求。我看官方文档有飞书的群聊机器人,其实差不多。


OK There are some functional differences. I currently implement it using the webhook method you mentioned. It is true that the demand is relatively niche. My application scenario is that a group chat robot receives notifications for personal identity. There is no way for individuals to authenticate the company. There should be no corporate ID. There is no limit for group chat robots, and the access link of the server sauce cannot be opened. , so this feature request was made. I saw that the official documentation includes Feishu’s group chat robot, which is actually pretty much the same.

mapxn commented 1 month ago

@axiaoxin

个人没有办法认证企业,应该是没有企业ID

非认证企业也是有企业ID的,对个人用户的限制主要在可信ip,企业应用必须配置一个固定的可信ip才能正常使用。


对于企业微信,现在新建的企业是强制要求配置可信ip(于2022年6月开始强制要求,见官方通知)。如果使用Vercel等serverless方式部署,每次的调用ip都可能不同,需要使用有固定ip的服务器进行中转,但既然有服务器了为什么还要使用serverless呢?

对于企业微信群机器人,则没有可信ip的限制,还是建议加上官方支持比较好。(看到飞书群聊机器人已经支持了,这两个非常类似)


@xiaoxin

There is no way for an individual to authenticate an enterprise, as there should be no enterprise ID.

Non-certified enterprises also have enterprise IDs. The restrictions on individual users are mainly based on trusted IP. Enterprise applications must be configured with a fixed trusted IP to be used normally.


For enterprise WeChat, it is now mandatory for newly established enterprises to configure trusted IP (it will be mandatory in June 2022, see official notice). If you use serverless deployment methods such as Vercel, the IP address may be different each time, and you need to use a server with a fixed IP for transfer. But since you already have a server, why use serverless?

For enterprise WeChat group robots, there are no restrictions on trusted IPs. It is recommended to add official support. (See that Feishu Group Chat Robot has been supported, the two are very similar)

axiaoxin commented 1 month ago

我现在是用一个接口接收回调,然后再转发到企业微信群聊做和简单新评论通知😂 目前使用中有两个体验问题感觉可以优化一下,一是我在后台回复别人也会收到评论通知,二是我在后台回复是没法快捷添加表情包


I now use an interface to receive callbacks, and then forward them to the corporate WeChat group chat for simple new comment notifications😂 There are currently two experience issues in use that I feel can be optimized. One is that I will receive comment notifications when I reply to others in the background, and the other is that I cannot quickly add emoticons when replying in the background

mapxn commented 1 month ago

@axiaoxin 这个Feature并没有被添加进来,可以把这个Feature Request重新打开吗? 我觉得可以根据飞书群机器人的实现 照葫芦画瓢添加一个,顺便解决你发现的问题。看有没有哪位可爱的大佬提个PR


@axiaoxin This Feature has not been added. Can you reopen this Feature Request? I think you can add one according to the implementation of Feishuqun robot, and solve the problems you found. Let’s see if any cute boss can suggest a PR