diff --git a/docs b/docs index e8e22ca1..3dbba4bc 160000 --- a/docs +++ b/docs @@ -1 +1 @@ -Subproject commit e8e22ca165ac1bc8a7435d5d55b3e94b1883d9d8 +Subproject commit 3dbba4bc60dc830c08d5343e438bcd003ba9d1c5 diff --git a/src/danog/MadelineProto/TL/Types/Button.php b/src/danog/MadelineProto/TL/Types/Button.php index cd718ac4..210cbbdb 100644 --- a/src/danog/MadelineProto/TL/Types/Button.php +++ b/src/danog/MadelineProto/TL/Types/Button.php @@ -47,6 +47,7 @@ class Button implements \JsonSerializable, \ArrayAccess $async = $params; } $async = isset($async['async']) ? $async['async'] : (isset($this->info['API']->wrapper) ? $this->info['API']->wrapper->async : true); + $method = $donotwait === true ? 'method_call_async_write' : 'method_call_async_read'; switch ($this->data['_']) { default: return false; @@ -56,10 +57,10 @@ class Button implements \JsonSerializable, \ArrayAccess $res = $this->info['API']->method_call_async_read('messages.sendMessage', ['peer' => $this->info['peer'], 'message' => $this->data['text'], 'reply_to_msg_id' => $this->info['id']], ['datacenter' => $this->info['API']->datacenter->curdc]); break; case 'keyboardButtonCallback': - $res = $this->info['API']->method_call_async_read('messages.getBotCallbackAnswer', ['peer' => $this->info['peer'], 'msg_id' => $this->info['id'], 'data' => $this->data['data']], ['noResponse' => $donotwait, 'datacenter' => $this->info['API']->datacenter->curdc]); + $res = $this->info['API']->$method('messages.getBotCallbackAnswer', ['peer' => $this->info['peer'], 'msg_id' => $this->info['id'], 'data' => $this->data['data']], ['datacenter' => $this->info['API']->datacenter->curdc]); break; case 'keyboardButtonGame': - $res = $this->info['API']->method_call_async_read('messages.getBotCallbackAnswer', ['peer' => $this->info['peer'], 'msg_id' => $this->info['id'], 'game' => true], ['noResponse' => $donotwait, 'datacenter' => $this->info['API']->datacenter->curdc]); + $res = $this->info['API']->$method('messages.getBotCallbackAnswer', ['peer' => $this->info['peer'], 'msg_id' => $this->info['id'], 'game' => true], ['datacenter' => $this->info['API']->datacenter->curdc]); break; } return $async ? $res : $this->wait($res);