Method: invokeWithBusinessConnection
Invoke a method using a Telegram Business Bot connection, see here » for more info, including a list of the methods that can be wrapped in this constructor.
Make sure to always send queries wrapped in a invokeWithBusinessConnection
to the datacenter ID, specified in the dc_id
field of the botBusinessConnection that is being used.
Parameters:
Name | Type | Description | Required |
---|---|---|---|
connection_id | string | Business connection ID. | Optional |
query | !X | The actual query. | Yes |
Return type: X
Can userbots use this method: YES
Can bots use this method: YES
MadelineProto Example (now async for huge speed and parallelism!):
if (!file_exists('madeline.php')) {
copy('https://phar.madelineproto.xyz/madeline.php', 'madeline.php');
}
include 'madeline.php';
$MadelineProto = new \danog\MadelineProto\API('session.madeline');
$MadelineProto->start();
$X = $MadelineProto->invokeWithBusinessConnection(connection_id: 'string', query: $!X, );