mirror of
https://github.com/Mayuri-Chan/pyrofork.git
synced 2025-12-29 20:14:51 +00:00
Add unknown_errors
Improve error messages. Signed-off-by: wulan17 <wulan17@nusantararom.org>
This commit is contained in:
parent
8fa49a9c43
commit
d501b66f93
2 changed files with 7 additions and 3 deletions
|
|
@ -63,6 +63,8 @@ CHANNEL_PARICIPANT_MISSING The current user is not in the channel
|
|||
CHANNEL_PRIVATE The channel/supergroup is not accessible
|
||||
CHANNEL_TOO_BIG The channel too big
|
||||
CHANNEL_TOO_LARGE The channel is too large
|
||||
CHARGE_ALREADY_REFUNDED The charge id was already used for a refund.
|
||||
CHARGE_NOT_FOUND The charge id was not found.
|
||||
CHAT_ABOUT_NOT_MODIFIED The chat about text was not modified because you tried to edit it using the same content
|
||||
CHAT_ABOUT_TOO_LONG The chat about text is too long
|
||||
CHAT_ADMIN_REQUIRED The method requires chat admin privileges
|
||||
|
|
@ -154,6 +156,7 @@ FILTER_TITLE_EMPTY The title field of the filter is empty
|
|||
FIRSTNAME_INVALID The first name is invalid
|
||||
FOLDER_ID_EMPTY The folder you tried to delete was already empty
|
||||
FOLDER_ID_INVALID The folder id is invalid
|
||||
FORM_ID_EXPIRED The specified id has expired.
|
||||
FRESH_CHANGE_ADMINS_FORBIDDEN You can't change administrator settings in this chat because your session was logged-in recently
|
||||
FROM_MESSAGE_BOT_DISABLED Bots can't use fromMessage min constructors
|
||||
FROM_PEER_INVALID The from peer value is invalid
|
||||
|
|
|
|||
|
|
|
@ -22,7 +22,7 @@ from datetime import datetime
|
|||
from importlib import import_module
|
||||
from typing import Type, Union
|
||||
|
||||
from pyrogram import raw
|
||||
from pyrogram import __version__, raw
|
||||
from pyrogram.raw.core import TLObject
|
||||
from .exceptions.all import exceptions
|
||||
|
||||
|
|
@ -40,12 +40,13 @@ class RPCError(Exception):
|
|||
is_unknown: bool = False,
|
||||
is_signed: bool = False
|
||||
):
|
||||
super().__init__("Telegram says: [{}{} {}] - {} {}".format(
|
||||
super().__init__("Telegram says: [{}{} {}] {} Pyrogram {} thinks: {}".format(
|
||||
"-" if is_signed else "",
|
||||
self.CODE,
|
||||
self.ID or self.NAME,
|
||||
f'(caused by "{rpc_name}")' if rpc_name else "",
|
||||
__version__,
|
||||
self.MESSAGE.format(value=value),
|
||||
f'(caused by "{rpc_name}")' if rpc_name else ""
|
||||
))
|
||||
|
||||
try:
|
||||
|
|
|
|||
Loading…
Reference in a new issue