fix and save
This commit is contained in:
parent
6633b5abc1
commit
d0eb376ce0
@ -18,7 +18,10 @@ def _get_vars(params: List[Tuple], kw: dict) -> List[AnyStr]:
|
||||
return result
|
||||
|
||||
|
||||
def telegram_notify(text: str, parse_mode: str = None, **kwargs):
|
||||
def telegram_notify(text: str,
|
||||
parse_mode: str = None,
|
||||
disable_web_page_preview: bool = False,
|
||||
**kwargs):
|
||||
chat_id, token = _get_vars([
|
||||
('chat_id', 'TELEGRAM_CHAT_ID'),
|
||||
('token', 'TELEGRAM_TOKEN')
|
||||
@ -30,6 +33,8 @@ def telegram_notify(text: str, parse_mode: str = None, **kwargs):
|
||||
}
|
||||
if parse_mode is not None:
|
||||
data['parse_mode'] = parse_mode
|
||||
if disable_web_page_preview:
|
||||
data['disable_web_page_preview'] = 1
|
||||
|
||||
r = requests.post('https://api.telegram.org/bot%s/sendMessage' % token, data=data)
|
||||
|
||||
|
7
pyproject.toml
Normal file
7
pyproject.toml
Normal file
@ -0,0 +1,7 @@
|
||||
[build-system]
|
||||
requires = [
|
||||
"setuptools>=54",
|
||||
"wheel",
|
||||
"requests",
|
||||
]
|
||||
build-backend = "setuptools.build_meta"
|
Loading…
x
Reference in New Issue
Block a user