Parameter | Choices/Defaults | Comments |
---|---|---|
chat_id - / required | Telegram group or user chat_id | |
msg - / required | What message you wish to send. | |
msg_format - added in 2.4 |
| Message format. Formatting options `markdown` and `html` described in Telegram API docs (https://core.telegram.org/bots/api#formatting-options). If option `plain` set, message will not be formatted. |
token - / required | Token identifying your telegram bot. |
Note
- name: send a message to chat in playbook telegram: token: '9999999:XXXXXXXXXXXXXXXXXXXXXXX' chat_id: 000000 msg: Ansible task finished
Common return values are documented here, the following are the fields unique to this module:
Key | Returned | Description |
---|---|---|
msg string | success | The message you attempted to send Sample: Ansible task finished |
telegram_error string | failure | Error message gotten from Telegram API Sample: Bad Request: message text is empty |
Hint
If you notice any issues in this documentation, you can edit this document to improve it.
© 2012–2018 Michael DeHaan
© 2018–2019 Red Hat, Inc.
Licensed under the GNU General Public License version 3.
https://docs.ansible.com/ansible/2.9/modules/telegram_module.html