Act as a telegram bot tracking and sending message
JavaScript Shell
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
assets
ci
src
tests
.dockerignore
.gitignore
Dockerfile
LICENSE
README.md
package.json
pipeline.yml
set-pipeline.sh
version
yarn.lock

README.md

telegram-resource

Act as a telegram bot tracking and sending messages

Add to a pipeline configuration

resource_types:
- name: telegram
  type: docker-image
  source:
    repository: carlocolombo/telegram-resource

Tags

  • latest stable build
  • latest-dev build from the latest commit

https://hub.docker.com/r/carlocolombo/telegram-resource/tags/

Source Configuration

  • telegram_key Required . Ask it to the BotFather
  • filter Optional. A regex string eg "/start"
  • flags Optional. String of flags eg "mi" for multiline and case insensitive. Check more on mdn

Example

resources:
- name: start
  type: telegram
  source:
    filter: '/start'
    flags: i
    telegram_key: {{telegram_bot_token}}

Fetching messages:

- get: start
  trigger: true

Send a full featured message:

- put: answer
  params:
    message: answer/message

Send a simple message:

- put: answer
  params:
    chat_id: answer/chat_id
    text: answer/text

Behavior

check: Check for new messages

Returns the recent messages sent to the telegram bot, if filter is defined it will return only the messages matching the regex

in: Read a message

Outputs 1 file:

  • message: Contains the message as retrieved from telegram api, it is a json rappresenting an update object. Only update of type message are supported right now

out: Send a message

Parameters

text and chat_id or message are required, if all present message has precedence over the pair chat_id text

  • text: Text of the message to be sent
  • chat_id: Unique identifier for the target chat or username of the target channel (in the format @channelusername)
  • message: A json rappresenting a full message to be sent using the api, https://core.telegram.org/bots/api#sendmessage

Example Configurations