Link Search Menu Expand Document

Method: invokeWithBusinessConnection

Back to methods index

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:

NameTypeDescriptionRequired
connection_idstringBusiness connection ID.Optional
query!XThe 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, );