utils.telegram: sendMessage with notification disabled
This commit is contained in:
@@ -5,14 +5,14 @@ with [AIOHTTP](https://github.com/aio-libs/aiohttp)
|
||||
through [Telegram Bot API](https://core.telegram.org/bots/api#sendmessage)
|
||||
|
||||
What this project do is very simple, it does not use any Telegram Bot API
|
||||
framework/library nor receive updates from Telegram, but calling `SendMessage`
|
||||
framework/library nor receive updates from Telegram, but calling `sendMessage`
|
||||
method of Telegram Bot API directly by sending `GET` requests through AIOHTTP.
|
||||
It should be able to be used along with any existing Telegram bot without
|
||||
conflicts.
|
||||
|
||||
1. Receive GitHub webhooks (`POST` request)
|
||||
2. Verify the SHA256 signature
|
||||
3. Format and send the text to a Telegram chat through "SendMessage" method of
|
||||
3. Format and send the text to a Telegram chat through "sendMessage" method of
|
||||
Telegram Bot API (`GET` request)
|
||||
|
||||
### Setup
|
||||
|
||||
+2
-1
@@ -52,7 +52,8 @@ async def send_message(session: ClientSession,
|
||||
chat_id=chat_id,
|
||||
text=text,
|
||||
parse_mode='HTML',
|
||||
disable_web_page_preview=True
|
||||
disable_web_page_preview=True,
|
||||
disable_notification=True
|
||||
)
|
||||
async with session.post(api_url,
|
||||
data=data) as resp: # type: ClientResponse
|
||||
|
||||
Reference in New Issue
Block a user