fix: check if event is subscribe

This commit is contained in:
lanvent
2023-04-21 13:43:01 +08:00
parent c9131b333b
commit f6d370ad29
2 changed files with 12 additions and 7 deletions

View File

@@ -30,9 +30,12 @@ class Query:
msg.event, msg.source
)
)
reply_text = subscribe_msg()
replyPost = create_reply(reply_text, msg)
return replyPost.render()
if msg.event in ["subscribe", "subscribe_scan"]:
reply_text = subscribe_msg()
replyPost = create_reply(reply_text, msg)
return replyPost.render()
else:
return "success"
wechatmp_msg = WeChatMPMessage(msg, client=channel.client)
if wechatmp_msg.ctype in [ContextType.TEXT, ContextType.IMAGE, ContextType.VOICE]:
from_user = wechatmp_msg.from_user_id