-
-
Notifications
You must be signed in to change notification settings - Fork 619
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
get updates #67
Comments
You must increment the offset like with the bot API. |
thanks. |
@shakibonline Yep, exactly like in the bot API |
I use this code
but it it didn't mark as read messages! what is wrong?? |
@shakibonline Of course not, you aren't using the offset properly. Read the bot API documentation or take a look at the examples in the repo. |
what about this one?
is it true? ps : i should store last offset for next run time? |
what is this error on running ( before load env & setting )
|
Nope, please check the official bot API documentation.
Nope, please check the official bot API documentation.
It sometimes happens, ignore it. |
thanks for answers.
did you mean this page? |
Nope, Google "telegram bot API documentation" |
Hi @danog |
Yes, use callbacks. |
I implement it: function onNewChannelMessage($update){ function onNewMessage($update){ $MadelineProto->eventManager()->bind('NewChannelMessage', 'onNewChannelMessage'); while(true){ |
@danog Hi. How did you implement non-blocking in php? |
I use pthreads for multithreading, but to enable it a ZTS version of PHP must be installed, along with the pthreads extension. |
@Amirjan: I'm trying to use your sample code: but the line throws an exception: I've also searched for "eventManager" in the whole source tree unsuccessfully. |
@Amirjan is clearly using a custom event manager, a pull request would be nice :3 |
@Amirjan Sure, send a pr! |
@Amirjan, your event manager looks so awesome! |
ApiEventsManager.php: listeners[$event][] = $callback; } public function fire($event, array $parameters) { if (!empty($this->listeners[$event])) { foreach ($this->listeners[$event] as $listener) { call_user_func_array($listener, $parameters); } } } } ?>in MTProto.php:
......
/MTProtoTools/UpdateHandler.php |
First, thank you for this awesome project !
how can i Handling updates?
I tried this link
https://github.com/danog/MadelineProto#handling-updates
but i can't understand it! that return me duplicate updates in loop.
How can i remove updates from get_updates after process updates?
The text was updated successfully, but these errors were encountered: