Is it possible to restrict the use of ALL commands for just one chat ID? How can I do this?
Sorry for my English.
You could extend Telegram class and ovewrite executeCommand()
use Longman\TelegramBot\Telegram;
use Longman\TelegramBot\Request;
class MyTelegram extends Telegram {
public function executeCommand($command) {
if($this->update->getMessage()) {
if($this->update->getMessage()->getChat()->getId() == 123456) {
return Request::emptyResponse();
}
}
return parent::executeCommand($command);
}
}
Thankee!
Most helpful comment
You could extend Telegram class and ovewrite executeCommand()