diff --git a/README.md b/README.md index ebb794b..0b5cac0 100755 --- a/README.md +++ b/README.md @@ -28,13 +28,16 @@ jobs: Notify a Telegram channel with a custom message at any point in a job with this custom step. -| Parameter | Type | Default | Description | -| ---------------------- | -------------- | ---------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `message` | `string` | Message from CircleCI. | Enter a custom message. | -| `telegram-bot-token` | `env_var_name` | TELEGRAM_BOT_TOKEN | Name of environment variable storing your Telegram bot token | -| `telegram-chat-id` | `env_var_name` | TELEGRAM_CHAT_ID | Name of environment variable storing your Telegram chat id | -| `parse_mode` | `string` | none | Use `Markdown` or `HTML`, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | -| `disable_notification` | `boolean` | none | Sends the message silently. Users will receive a notification with no sound. | +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `message` | `string` | Message from CircleCI. | Enter a custom message. | +| `telegram-bot-token` | `env_var_name` | TELEGRAM_BOT_TOKEN | Name of environment variable storing your Telegram bot token | +| `telegram-chat-id` | `env_var_name` | TELEGRAM_CHAT_ID | Name of environment variable storing your Telegram chat id | +| `parse_mode` | `string` | none | Use `Markdown` or `HTML`, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | +| `disable_notification` | `boolean` | none | Sends the message silently. Users will receive a notification with no sound. | +| `disable_web_page_preview` | `boolean` | none | Disables link previews for links in this message | +| `reply_markup` | `InlineKeyboardMarkup` or `ReplyKeyboardMarkup` or `ReplyKeyboardRemove` or `ForceReply` | none | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user | + Example: @@ -186,13 +189,16 @@ jobs: Notify a Telegram channel. -| Parameter | Type | Default | Description | -| ---------------------- | -------------- | -------------------------- | -------------------------------------------------------------------------------------------------------------------------------- | -| `message` | `string` | Job Message from CircleCI! | Enter a custom message. | -| `telegram-bot-token` | `env_var_name` | TELEGRAM_BOT_TOKEN | Name of environment variable storing your Telegram bot token | -| `telegram-chat-id` | `env_var_name` | TELEGRAM_CHAT_ID | Name of environment variable storing your Telegram chat id | -| `parse_mode` | `string` | none | Use `Markdown` or `HTML`, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | -| `disable_notification` | `boolean` | none | Sends the message silently. Users will receive a notification with no sound. | +| Parameter | Type | Default | Description | +|-----------|------|---------|-------------| +| `message` | `string` | Job Message from CircleCI! | Enter a custom message. | +| `telegram-bot-token` | `env_var_name` | TELEGRAM_BOT_TOKEN | Name of environment variable storing your Telegram bot token | +| `telegram-chat-id` | `env_var_name` | TELEGRAM_CHAT_ID | Name of environment variable storing your Telegram chat id | +| `parse_mode` | `boolean` | none | Use `Markdown` or `HTML`, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in your bot's message. | +| `disable_notification` | `boolean` | none | Sends the message silently. Users will receive a notification with no sound. | +| `disable_web_page_preview` | `boolean` | none | Disables link previews for links in this message | +| `reply_markup` | `InlineKeyboardMarkup` or `ReplyKeyboardMarkup` or `ReplyKeyboardRemove` or `ForceReply` | none | Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user | + Example: @@ -205,6 +211,7 @@ orbs: jobs: - telegram/notify: message: "Notification from CircleCI!" + disable_web_page_preview: true ``` ## Help diff --git a/src/commands/notify.yml b/src/commands/notify.yml index 09429e5..d9ad978 100644 --- a/src/commands/notify.yml +++ b/src/commands/notify.yml @@ -24,14 +24,19 @@ parameters: type: string default: none - disable_notification: - description: Sends the message silently. Users will receive a notification with no sound. + disable_web_page_preview: + description: Disables link previews for links in this message. type: boolean - default: false + default: none + + reply_markup: + description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. + type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply + default: none steps: - run: name: Telegram notification shell: /bin/bash command: | - curl "https://api.telegram.org/bot$<>/sendMessage?chat_id=$<>&parse_mode=<< parameters.parse_mode >>&disable_notification=<< parameters.disable_notification >>&text=<< parameters.message >>" + curl "https://api.telegram.org/bot$<>/sendMessage?chat_id=$<>&parse_mode=<< parameters.parse_mode >>&reply_markup=<< parameters.reply_markup >>&disable_web_page_preview=<< parameters.disable_web_page_preview >>&disable_notification=<< parameters.disable_notification >>&text=<< parameters.message >>" diff --git a/src/examples/notify.yml b/src/examples/notify.yml index 29188ee..acb2ba0 100644 --- a/src/examples/notify.yml +++ b/src/examples/notify.yml @@ -13,6 +13,8 @@ usage: steps: - telegram/notify: message: "Custom notification message." + reply_to_message_id: 3 + disable_web_page_preview: true workflows: your-workflow: diff --git a/src/jobs/notify.yml b/src/jobs/notify.yml index 4087293..7ff5432 100755 --- a/src/jobs/notify.yml +++ b/src/jobs/notify.yml @@ -23,6 +23,16 @@ parameters: type: string default: none + disable_web_page_preview: + description: Disables link previews for links in this message. + type: boolean + default: none + + reply_markup: + description: Additional interface options. A JSON-serialized object for an inline keyboard, custom reply keyboard, instructions to remove reply keyboard or to force a reply from the user. + type: InlineKeyboardMarkup or ReplyKeyboardMarkup or ReplyKeyboardRemove or ForceReply + default: none + disable_notification: description: Sends the message silently. Users will receive a notification with no sound. type: boolean @@ -36,4 +46,7 @@ steps: telegram-bot-token: << parameters.telegram-bot-token >> telegram-chat-id: << parameters.telegram-chat-id >> parse_mode: << parameters.parse_mode >> + disable_web_page_preview: << parameters.disable_web_page_preview >> + reply_markup: << parameters.reply_markup >> disable_notification: << parameters.disable_notification >> +