-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Server消息回复必须以事件方式吗? #140
Comments
@iam993 你在事件里做啥都行啊,没做啥封装啊。 |
$str = "test"; 那怎么在回调方法内方便的调用方法外的变量呢? |
http://php.net/manual/zh/functions.anonymous.php $foo = 1;
function ($xxx) use ($foo, $bar, ....其它) |
我重构了你server这块,能实现了,但是不那么‘优雅’ ,勉强凑合用吧。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
看了一下代码,如果要回复消息,必须使用server的on方法来驱动。
有没有一种方法,消息类型,内容等自己判断,然后通过类似
setReplyMessage ( Message::make ( 'text' )->content( 'test' ) );
最后使用echo $server->serve();
或者说直接replyMessage ( Message::make ( 'text' )->content( 'test' ) );
总感觉靠server的事件驱动回复有点过度封装了。
The text was updated successfully, but these errors were encountered: