Giter Site home page Giter Site logo

woltsu / telegram-orb Goto Github PK

View Code? Open in Web Editor NEW
11.0 2.0 14.0 101 KB

Create custom Telegram notifications in CircleCI

Home Page: https://circleci.com/orbs/registry/orb/woltsu/telegram

License: MIT License

Shell 100.00%
circleci-orbs circleci-orb

telegram-orb's Introduction

telegram-orb CircleCI CircleCI Orb Version

Easily integrate custom Telegram notifications into your CircleCI projects.

Learn more about Orbs.

Usage

Example config:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/<command>

Commands

Notify

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.

Example:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/notify:
          message: "Notification from CircleCI!"

GetMe

A simple method for testing your bot's auth token. Returns basic information about the bot in form of a User object.

Parameter Type Default Description
telegram-bot-token env_var_name TELEGRAM_BOT_TOKEN Name of environment variable storing your Telegram bot token

Example:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/getme

GetChat

A method to get up to date information about the chat (current name of the user for one-on-one conversations, current username of a user, group or channel, etc.) Returns a Chat object on success.

Parameter Type Default Description
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

Example:

version: 2.1
orbs:
  telegram: woltsu/[email protected]
jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/getchat

SendSticker

Send a sticker to Telegram

Parameter Type Default Description
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
telegram-sticker string "" file_id or url to .webp

Example:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/sendSticker:
          telegram-sticker: "https://www.example.com/img.webp"

SendGIF

A command which sends an animated image to the specified Telegram chat.

Parameter Type Default Description
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
gif-url string Enter the image's URL

Example:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/sendgif:
          gif-url: "https://www.example.com/img.gif"

SendPhoto

A command which sends an image to the specified Telegram chat.

Parameter Type Default Description
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
image-url string Enter the image's URL

Example:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  build:
    docker:
      - image: <docker image>
    steps:
      - telegram/sendphoto:
          image-url: "https://www.example.com/img.jpg"

Jobs

Notify

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.

Example:

version: 2.1

orbs:
  telegram: woltsu/[email protected]

jobs:
  - telegram/notify:
      message: "Notification from CircleCI!"

Help

How to create a Telegram bot

https://core.telegram.org/bots

How To Get A Chat Id

https://stackoverflow.com/questions/32423837/telegram-bot-how-to-get-a-group-chat-id

Remember to add your bot into the channel!

How to setup CircleCI environment

In the settings page for your project on CircleCI, click Environment Variables. There you need to add 2 variables: TELEGRAM_BOT_TOKEN and TELEGRAM_CHAT_ID.

telegram-orb's People

Contributors

amoldskred avatar artplan1 avatar jakousa avatar rochet2 avatar willumz avatar woltsu avatar xneme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

telegram-orb's Issues

Params validation

Currently the commands assume that the env variables exist. Some validation would be neat.

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.