Giter VIP home page Giter VIP logo

telegram-notification's Introduction

Telegram Notifications for Azure Pipelines

TelegramTask Telegram Notification task uses Telegraf - Telegram Bot Framework for Node.js and allows you to send customizable notifications to your Telegram chats and groups. This task has some predefined options of what info (e.g build/release status, ID etc.) to include in the message about your build/release process.

Getting started

Only three steps to start receiving your notifications: 1. Create a Bot 2. Get Chat Ids 3. Customize your notifications

Follow the instructions below to configure the Telegram Notifications task to send messages to a group or chat.

Create a Bot

First of all, you need to create a Telegram bot which will later send all the notifications to your chats.

  • Talk to Bot Father: follow Bot Father's instructions and create a bot
  • Save Bot Token: this token will be used by the task Bot Token
  • Add your bot to every chat you want to be notified

Having a bot allows you to fully customize its appearance (nickname, user picture) and add it to as many chats or groups as you want.

Obtain chat IDs

Currently, Telegram doesn't offer a convenient way to obtain all chat IDs from bot API. So there are two ways to do it:

1. Add @RawDataBot to your group

Upon joining it will send a JSON where your chat ID will be located at message.chat.id. RawDataBot

Don't forget to remove the bot from chat right after.

2. Use built-in "Get chat ID" feature (Preview)

If you want the bot to send notifications directly to you (not a group), the trick with @RawDataBot won't work. You need to:

  • Check "Get chat Id" in task properties

GetChatId

  • Queue build or release: please make sure that this action won't affect any of your production processes. I suggest creating empty build\release definition just to get chat ID and then paste them into the real task.
  • Type /chat: while the task is running use /chat command in every chat where your bot is present SendChatCommand
  • Type /stop: use this command to finish task execution
  • Paste your chat IDs to task properties: copy all your IDs to task property (use comma as delimiter e.g -123456678,321654987)

Customize your message

There are some basic predefined features both for build and release tasks.

General

  • Add task status - shows whether the task finished successfully, failed or has some issues.

In order this to work properly, don't forget to change run conditions of the task to "Even if a previous task has failed"

  • Add project link - adds a link to your team project
  • Message - add a custom message to your notification. You can use html markup.

For Release

  • Name - The name of the current release.
  • Created by - The display name of identity that triggered the release.

For Build

  • Number - The name of the completed build.
  • Queued by - The display name of identity that queued the build.

NOTE: USE EITHER RELEASE OR BUILD RELATED OPTIONS DEPENDING ON YOUR PROCESS

NotificationResult

telegram-notification's People

Contributors

jackb1ack avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.