Gehe zum Inhalt

Aurium

Zurück zu Blog
Full screen

Telegram Bot API Proposal: Alarm Notification Method

May 10, 2018 15:37 , von Aurélio A. Heckert - 0no comments yet | No one following this article yet.
Viewed 167 times

Personal assistant bots could need to emergency notify. It is not enough to have a message notification for heavy users or for who is not using the smartphone or other device with a telegram client in that emergency moment.

 

For instance:

  • An assistant bot my need to notify an schedule marked as important. To ensure that the user will see the notification in time, the bot could ask the client to alarm the user.
  • A server monitoring tool with a bot interface could alarm the server admin when worrying event happens.

 

Specification

 

sendAlarm

Use this method to send alarm messages. On success, the sent Message is returned. The optional photo will be presented on the "highlighted chat alarm message" and as a background on the device alarm when it is possible. An "highlighted chat alarm message" must display a button to enable/disable this bot alarm. Bot developers must consider to send a request message with enable_alarmKeyboardButton, before the first alarm.

 

Parameters Type Required Description
chat_id Integer or String Yes Unique identifier for the target chat or username of the target channel (in the format @channelusername). Yes it may try to alarm all group.
text String Yes Text of the alarm. This text will be show as a highlighted message in the chat and in the device alarm.
parse_mode String Optional Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message.
photo InputFile or String Optional Photo to send. Pass a file_id as String to send a photo that exists on the Telegram servers (recommended), pass an HTTP URL as a String for Telegram to get a photo from the Internet, or upload a new photo using multipart/form-data.

 

KeyboardButton

Add this field:

enable_alarm Boolean Optional. If True, a button to enable bot alarm will be show to the user. (It do not need to be show if the user already enabled this bot to alarm)

 

Android Screen Proposal

Telegram alarm notification
A ring tone must play with.


Tags zu diesem Artikel: telegram proposal

0no comments yet

    Einen Kommentar schreiben

    The highlighted fields are mandatory.

    Wenn Sie ein registrierter Nutzer sind, dann können Sie sich anmelden und automatisch unter Ihrem Namen arbeiten.

    Abbrechen