Comments (12)
先判断type,再条件化解析content
from wechatbot-webhook.
@danni-cool thank u, 已解决。
那个post的想法,其实就是想实现这么一个功能:
@app.post("/wc_receive")
def handle_wcbot_msg_receive_callback(type: str = Form(...),
...
isSystemEvent: Optional[str] = Form(None)):
if type == 'text':
# send msg from http://localhost:3001/webhook/msg
room = source['room']
from_part = source['from']
print(source)
if room != "":
print('msg from room: ', room['payload']['topic'])
else:
from_name = from_part['payload']['name']
print('msg from: ', from_name)
print(content)
# get id and resend
rsp = llm(content)
return {"text": rsp}
在这里return 一个回复,有办法可以实现吗?
from wechatbot-webhook.
不能,独立于不同网段的http服务,用python也没法实现这个功能吧,你这种适合组装功能在一起
from wechatbot-webhook.
不是,我的意思是不是客户端post的这个请求吗? 为什么不能把post的返回利用起来呢
from wechatbot-webhook.
客户端不是本身就可以提供http访问推送消息吗? 那我理解客户端应该具备给某个用户发消息的能力,直接把post的返回推送给发送方,就实现了回复拦截、处理、再回应的功能.
不然的话,就必须得两台服务
from wechatbot-webhook.
这些都可以实现,只是这样的业务很重,拦截处理再回应,这种更像sdk该干的活。
我的服务走 http 接口,本身就是为了把繁琐的服务独立于这个收发体系之外,就像微信只是个工具,你的大脑去想要发什么。
如果既不想直接改代码,又要做拦截器、自定义回复,又要考虑不同语言之间兼容性你会如何设计?
from wechatbot-webhook.
我看了一下,eatapple的那个wechat sdk golang的似乎更好一点,自由度高
from wechatbot-webhook.
我看了一下,eatapple的那个wechat sdk golang的似乎更好一点,自由度高
你的需求要的是一个SDK
from wechatbot-webhook.
客户端不是本身就可以提供http访问推送消息吗? 那我理解客户端应该具备给某个用户发消息的能力,直接把post的返回推送给发送方,就实现了回复拦截、处理、再回应的功能.
不然的话,就必须得两台服务
@lucasjinreal 今天又考虑了下这个问题,确实post请求利用起来,就只要一台公网的ip服务器,最近正在实现这点
from wechatbot-webhook.
对的,其实这是双向回路的一个特例:当且仅当及时回复的场景适用,例如聊天AI。
实现好了叫我
from wechatbot-webhook.
对的,其实这是双向回路的一个特例:当且仅当及时回复的场景适用,例如聊天AI。 实现好了叫我
ok,碰巧在实现好友邀请时考虑到这个问题,但是如果大量slave机器post请求到你服务器,是不是得考虑并发问题
from wechatbot-webhook.
我以前考虑的是给用户用,但是这得让服务器登录许多个微信,感觉不太现实,如果只是我的微信,那就只是回复艾特我的消息了。
考虑到微信的频率限制,这个频次应该不会太高
from wechatbot-webhook.
Related Issues (20)
- 配合 token=[YOUR_PERSONAL_TOKEN] 解密的方式是? HOT 3
- 稳定性相对于wechaty如何? HOT 2
- 接收消息后,总是会多调用一次收消息的api HOT 1
- 小白出现的问题,希望得到回复 HOT 2
- 读取文件并发送提示错误not a valid json HOT 2
- 推消息API,如果换行,则发不出去 HOT 3
- 补充换行发不出信息的说明 HOT 2
- 登录后报错,AxiosError: Request failed with status code 503,然后掉线 HOT 2
- 功能请求:支持通过Webhook发送消息时@群成员 HOT 1
- 通过base64发送图片 HOT 3
- 可以发送带引用的消息吗? HOT 1
- 希望回调请求添加事件通知相关信息 HOT 3
- 在photon下面的docker,无法接收到信息 HOT 6
- 登录出现问题 1205 == 0 HOT 2
- 隔一段时间会自动登出,调用api发送消息时报you must login first HOT 4
- docker 部署完 调用测试发送api 出现 1204 == 0 HOT 3
- 处理【合并消息转发】的消息 HOT 1
- 新添加的好友 没办法 马上交流 只能重新登录后 HOT 1
- 接收api 返回正常消息后 ,马上会吊起 type = system_event_push_notify 这个是直接忽略还是 需用做回复? HOT 1
- 群 里面个人昵称问题 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from wechatbot-webhook.