Long polling! File downloading!
Pre-release
Pre-release
You can now use long polling (getUpdates) by simply creating a function which accepts an update, and starting polling with handle_updates
:
function dumper($update){
var_dump($update); //do whatever you want in here
}
$bot->handle_updates('dumper'); //blocks forever
See the function docs for parameter details.
You can download files by passing a file_id
to downloadFile
, and it will do one of 3 things, depending on the type of the destination
:
null
, omitted:
content is returned directlystring
:
content is output into the given string, as a pathresource
:
content is written withfwrite
Note that this has not been extensively tested.