mirror of
https://github.com/danog/MadelineProto.git
synced 2024-11-26 21:14:43 +01:00
Add support for invokeWithBusinessConnection
This commit is contained in:
parent
62b06f1bf0
commit
b4e0a7823a
@ -565,6 +565,11 @@ final class Connection
|
||||
'invokeWithTakeout',
|
||||
['takeout_id' => $message->takeoutId, 'query' => $body],
|
||||
);
|
||||
} elseif ($message->businessConnectionId !== null) {
|
||||
$body = $this->API->getTL()->serializeMethod(
|
||||
'invokeWithBusinessConnection',
|
||||
['connection_id' => $message->businessConnectionId, 'query' => $body],
|
||||
);
|
||||
}
|
||||
} else {
|
||||
$body['_'] = $message->constructor;
|
||||
|
@ -124,6 +124,7 @@ class MTProtoOutgoingMessage extends MTProtoMessage
|
||||
*/
|
||||
public readonly ?int $floodWaitLimit = null,
|
||||
public readonly ?int $takeoutId = null,
|
||||
public readonly ?string $businessConnectionId = null,
|
||||
private ?DeferredFuture $resultDeferred = null,
|
||||
public readonly ?Cancellation $cancellation = null
|
||||
) {
|
||||
|
@ -176,7 +176,8 @@ trait CallHandler
|
||||
floodWaitLimit: $args['floodWaitLimit'] ?? null,
|
||||
resultDeferred: $response,
|
||||
cancellation: $cancellation,
|
||||
takeoutId: $args['takeoutId'] ?? null
|
||||
takeoutId: $args['takeoutId'] ?? null,
|
||||
businessConnectionId: $args['businessConnectionId'] ?? null,
|
||||
);
|
||||
if ($queueId !== null) {
|
||||
$this->callQueue[$queueId] = $message;
|
||||
|
@ -388,6 +388,11 @@ final class Blacklist {
|
||||
$signature []= "?int \$takeoutId = null";
|
||||
}
|
||||
|
||||
if (\in_array($method, ['messages.sendMessage', 'messages.editMessage', 'messages.sendMedia', 'messages.sendMultiMedia', 'messages.setTyping'], true)) {
|
||||
$contents .= " * @param ?string \$businessConnectionId Business connection ID, received through an updateBotBusinessConnect update.\n";
|
||||
$signature []= "?string \$businessConnectionId = null";
|
||||
}
|
||||
|
||||
return [$contents, $signature];
|
||||
}
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user