Replies: 1 comment
-
OfficialAccountEnum::MSG_TYPE_EVENT 定义 event |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
$server = (new WeChatOaService())->getServer();
// 事件
$server->addMessageListener(OfficialAccountEnum::MSG_TYPE_EVENT, function ($message, \Closure $next) {
Log::write('关注公众号',json_encode($message,JSON_UNESCAPED_UNICODE));
switch ($message['Event']) {
case OfficialAccountEnum::EVENT_SUBSCRIBE: // 关注事件
// 回复
$replyContent = OfficialAccountReply::where([
'reply_type' => OfficialAccountEnum::REPLY_TYPE_FOLLOW,
'status' => YesNoEnum::YES
])
->value('content');
Beta Was this translation helpful? Give feedback.
All reactions