summaryrefslogtreecommitdiff
path: root/ch1p
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2021-12-10 19:09:13 +0300
committerEvgeny Zinoviev <me@ch1p.io>2021-12-10 19:09:13 +0300
commitd0eb376ce09207968af9287bfa7db6da58f2f9e4 (patch)
treeefc6c937459878c32b33e043a0decd4d86321a15 /ch1p
parent6633b5abc13813ac3720b8269e4f498527d11372 (diff)
fix and saveHEADmaster
Diffstat (limited to 'ch1p')
-rw-r--r--ch1p/functions.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/ch1p/functions.py b/ch1p/functions.py
index 51335f8..256b594 100644
--- a/ch1p/functions.py
+++ b/ch1p/functions.py
@@ -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)