Merge Beta with Stable releases #1
@ -22,8 +22,21 @@ class UserInvalidError(Exception):
|
|||||||
super().__init__(f"Could not find HoloUser by using {type(self.user)} as an input type")
|
super().__init__(f"Could not find HoloUser by using {type(self.user)} as an input type")
|
||||||
|
|
||||||
class HoloUser():
|
class HoloUser():
|
||||||
|
"""This object represents a user of HoloChecker bot.
|
||||||
|
It is primarily used to interact with a database in a more python-friendly way,
|
||||||
|
as well as provide better programming experience in case of adding new features, etc.
|
||||||
|
"""
|
||||||
|
|
||||||
def __init__(self, user: Union[List[User], User, ChatMember, int, str]) -> None:
|
def __init__(self, user: Union[User, List[User], ChatMember, int, str]) -> None:
|
||||||
|
"""A user of Holo bot. Used to simplify DB interaction.
|
||||||
|
|
||||||
|
### Args:
|
||||||
|
* user (`Union[User, List[User], ChatMember, int, str]`): Any possible way to identify the user. Pass `User` object, user's telegram ID, username or something...
|
||||||
|
|
||||||
|
### Raises:
|
||||||
|
* UserInvalidError: Provided to `HoloUser` object is not supported
|
||||||
|
* UserNotFoundError: `HoloUser` could not find user with such an ID in database
|
||||||
|
"""
|
||||||
|
|
||||||
# Determine input object class and extract id
|
# Determine input object class and extract id
|
||||||
if isinstance(user, list) and len(user) != 0:
|
if isinstance(user, list) and len(user) != 0:
|
||||||
@ -97,8 +110,8 @@ class HoloUser():
|
|||||||
* file (`Union[str, Document, None]`, optional): File as a document object or file_id as a string. Defaults to None.
|
* file (`Union[str, Document, None]`, optional): File as a document object or file_id as a string. Defaults to None.
|
||||||
* animation (`Union[str, Animation, None]`, optional): Animation as an animation object or file_id as a string. Defaults to None.
|
* animation (`Union[str, Animation, None]`, optional): Animation as an animation object or file_id as a string. Defaults to None.
|
||||||
* voice (`Union[str, Voice, None]`, optional): Voice as a voice object or file_id as a string. Defaults to None.
|
* voice (`Union[str, Voice, None]`, optional): Voice as a voice object or file_id as a string. Defaults to None.
|
||||||
* adm_origin (`bool`, optional): Whether origin sender is an admin. Defaults to False.
|
* adm_origin (`bool`, *optional*): Whether origin sender is an admin. Defaults to False.
|
||||||
* adm_context (`bool`, optional): Whether context sender is an admin. Defaults to False.
|
* adm_context (`bool`, *optional*): Whether context sender is an admin. Defaults to False.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if text is not None:
|
if text is not None:
|
||||||
|
Reference in New Issue
Block a user