Skip to content

Commit c252eca

Browse files
committed
Bump RPC errors
1 parent e976147 commit c252eca

9 files changed

Lines changed: 248 additions & 14 deletions

src/Lang.php

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,17 +21,16 @@
2121
final class Lang
2222
{
2323
public const PERCENTAGES = [
24-
'zh_Hans' => 98,
24+
'zh_Hans' => 100,
2525
'en' => 100,
26-
'fr' => 35,
26+
'fr' => 36,
2727
'de' => 0,
2828
'he' => 100,
2929
'it' => 100,
30-
'ckb' => 73,
31-
'fa' => 98,
32-
'pl' => 1,
30+
'ckb' => 74,
31+
'fa' => 100,
3332
'pt' => 81,
34-
'ru' => 81,
33+
'ru' => 82,
3534
'uz' => 100,
3635
];
3736

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
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 &raquo;](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 &raquo;](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+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
* BalanceTooLowError 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+
* The transaction cannot be completed because the current [Telegram Stars balance](https://core.telegram.org/api/stars) is too low.
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 BalanceTooLowError extends RPCErrorException
30+
{
31+
protected function __construct(int $code, string $caller, ?\Exception $previous = null)
32+
{
33+
parent::__construct('BALANCE_TOO_LOW', 'The transaction cannot be completed because the current [Telegram Stars balance](https://core.telegram.org/api/stars) is too low.', $code, $caller, $previous);
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
* ChannelMonoforumUnsupportedError 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+
* [Monoforums](https://core.telegram.org/api/channel#monoforums) do not support this feature.
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 ChannelMonoforumUnsupportedError extends RPCErrorException
30+
{
31+
protected function __construct(int $code, string $caller, ?\Exception $previous = null)
32+
{
33+
parent::__construct('CHANNEL_MONOFORUM_UNSUPPORTED', '[Monoforums](https://core.telegram.org/api/channel#monoforums) do not support this feature.', $code, $caller, $previous);
34+
}
35+
}

src/RPCError/FileReferenceExpiredError.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
use danog\MadelineProto\RPCErrorException;
2121

2222
/**
23-
* File reference expired, it must be refetched as described in [the documentation](https://core.telegram.org/api/file_reference).
23+
* File reference expired, it must be refetched as described in [the documentation](https://core.telegram.org/api/file-references).
2424
*
2525
* Note: this exception is part of the raw API, and thus is not covered by the backwards-compatibility promise.
2626
*
@@ -30,6 +30,6 @@ final class FileReferenceExpiredError extends RPCErrorException
3030
{
3131
protected function __construct(int $code, string $caller, ?\Exception $previous = null)
3232
{
33-
parent::__construct('FILE_REFERENCE_EXPIRED', 'File reference expired, it must be refetched as described in [the documentation](https://core.telegram.org/api/file_reference).', $code, $caller, $previous);
33+
parent::__construct('FILE_REFERENCE_EXPIRED', 'File reference expired, it must be refetched as described in [the documentation](https://core.telegram.org/api/file-references).', $code, $caller, $previous);
3434
}
3535
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
* QuickRepliesBotNotAllowedError 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+
* [Quick replies](https://core.telegram.org/api/business#quick-reply-shortcuts) cannot be used by bots.
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 QuickRepliesBotNotAllowedError extends RPCErrorException
30+
{
31+
protected function __construct(int $code, string $caller, ?\Exception $previous = null)
32+
{
33+
parent::__construct('QUICK_REPLIES_BOT_NOT_ALLOWED', '[Quick replies](https://core.telegram.org/api/business#quick-reply-shortcuts) cannot be used by bots.', $code, $caller, $previous);
34+
}
35+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
<?php declare(strict_types=1);
2+
/**
3+
* TodoItemDuplicateError 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+
* Duplicate [checklist items](https://core.telegram.org/api/todo) detected.
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 TodoItemDuplicateError extends RPCErrorException
30+
{
31+
protected function __construct(int $code, string $caller, ?\Exception $previous = null)
32+
{
33+
parent::__construct('TODO_ITEM_DUPLICATE', 'Duplicate [checklist items](https://core.telegram.org/api/todo) detected.', $code, $caller, $previous);
34+
}
35+
}

0 commit comments

Comments
 (0)