|
| 1 | +<?php declare(strict_types=1); |
| 2 | +/** |
| 3 | + * AllowPaymentRequiredError error. |
| 4 | + * |
| 5 | + * This file is part of MadelineProto. |
| 6 | + * MadelineProto is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. |
| 7 | + * MadelineProto is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
| 8 | + * See the GNU Affero General Public License for more details. |
| 9 | + * You should have received a copy of the GNU General Public License along with MadelineProto. |
| 10 | + * If not, see <http://www.gnu.org/licenses/>. |
| 11 | + * |
| 12 | + * @author Daniil Gentili <daniil@daniil.it> |
| 13 | + * @copyright 2016-2025 Daniil Gentili <daniil@daniil.it> |
| 14 | + * @license https://opensource.org/licenses/AGPL-3.0 AGPLv3 |
| 15 | + * @link https://docs.madelineproto.xyz MadelineProto documentation |
| 16 | + */ |
| 17 | + |
| 18 | +namespace danog\MadelineProto\RPCError; |
| 19 | + |
| 20 | +use danog\MadelineProto\RPCErrorException; |
| 21 | + |
| 22 | +/** |
| 23 | + * This peer only accepts [paid messages »](https://core.telegram.org/api/paid-messages): this error is only emitted for older layers without paid messages support, so the client must be updated in order to use paid messages. . |
| 24 | + * |
| 25 | + * Note: this exception is part of the raw API, and thus is not covered by the backwards-compatibility promise. |
| 26 | + * |
| 27 | + * Always check the changelog when upgrading, and use tools like Psalm to easily upgrade your code. |
| 28 | + */ |
| 29 | +final class AllowPaymentRequiredError extends RPCErrorException |
| 30 | +{ |
| 31 | + protected function __construct(int $code, string $caller, ?\Exception $previous = null) |
| 32 | + { |
| 33 | + parent::__construct('ALLOW_PAYMENT_REQUIRED', 'This peer only accepts [paid messages »](https://core.telegram.org/api/paid-messages): this error is only emitted for older layers without paid messages support, so the client must be updated in order to use paid messages. .', $code, $caller, $previous); |
| 34 | + } |
| 35 | +} |
0 commit comments