mirror of https://github.com/coddrago/Heroku
Hotfix
parent
495ef51acd
commit
94a7bdc221
|
@ -118,18 +118,17 @@ def get_chat_id(message: Message) -> int:
|
||||||
|
|
||||||
|
|
||||||
def get_entity_id(
|
def get_entity_id(
|
||||||
*,
|
|
||||||
entity: Union[Chat, User, Channel, PeerChat, PeerChat, PeerChannel]
|
entity: Union[Chat, User, Channel, PeerChat, PeerChat, PeerChannel]
|
||||||
) -> int:
|
) -> int:
|
||||||
return telethon.utils.get_peer_id(entity)
|
return telethon.utils.get_peer_id(entity)
|
||||||
|
|
||||||
|
|
||||||
def escape_html(*, text: str) -> str:
|
def escape_html(text: str) -> str:
|
||||||
"""Pass all untrusted/potentially corrupt input here"""
|
"""Pass all untrusted/potentially corrupt input here"""
|
||||||
return str(text).replace("&", "&").replace("<", "<").replace(">", ">")
|
return str(text).replace("&", "&").replace("<", "<").replace(">", ">")
|
||||||
|
|
||||||
|
|
||||||
def escape_quotes(*, text: str) -> str:
|
def escape_quotes(text: str) -> str:
|
||||||
"""Escape quotes to html quotes"""
|
"""Escape quotes to html quotes"""
|
||||||
return escape_html(text).replace('"', """)
|
return escape_html(text).replace('"', """)
|
||||||
|
|
||||||
|
@ -361,7 +360,7 @@ async def get_target(message: Message, arg_no: int = 0) -> Union[int, None]:
|
||||||
return entity.id
|
return entity.id
|
||||||
|
|
||||||
|
|
||||||
def merge(*, a: dict, b: dict) -> dict:
|
def merge(a: dict, b: dict) -> dict:
|
||||||
"""Merge with replace dictionary a to dictionary b"""
|
"""Merge with replace dictionary a to dictionary b"""
|
||||||
for key in a:
|
for key in a:
|
||||||
if key in b:
|
if key in b:
|
||||||
|
@ -439,7 +438,7 @@ def get_link(user: Union[User, Channel]) -> str:
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
def chunks(*, _list: Union[list, tuple, set], n: int) -> list:
|
def chunks(_list: Union[list, tuple, set], n: int) -> list:
|
||||||
"""Split provided `_list` into chunks of `n`"""
|
"""Split provided `_list` into chunks of `n`"""
|
||||||
return [_list[i : i + n] for i in range(0, len(_list), n)]
|
return [_list[i : i + n] for i in range(0, len(_list), n)]
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue