Bringing webhooks into Telegram. Push messages to chats via URL with a simple API.

Last update: Jul 22, 2022

wakatime License Java CI with Gradle

Webhooks over Telegram (WoT)

WoT aims to provide a simple API for registering webhooks and sending messages to Telegram chats via them using a single secret URL. Just like in Discord or Slack. You simply POST a message to chats:

Table of contents

Features

  • Easy-to-use RESTful API
  • Simple authorization
  • Simple subscribing and unsubscribing process
  • Multiple webhooks support
  • Formatting support
  • Attachments support (WIP)
  • Multiplatform Kotlin SDK for WoT (WIP)
  • Automatic payload mapping from other services (WIP)
  • Supervisor Bot that simplifies interactions with the API (WIP)

Running

To run the server you should have Java 17+ and Docker Compose installed.

Build the image:

./gradlew wot-server:bootBuildImage

Edit the docker-compose.yml file and configure the secret key used for authorization:

# ./wot-server/docker/docker-compose.yml
# ...
services:
  # ...
  wot-server:
    # ...
    environment:
      # ...
      SIMPLE_SECURITY_AUTHENTICATION_SECRET: my_secret_key
      # ...
    # ...
  # ...
# ...

Run the containers:

docker-compose -f ./wot-server/docker/docker-compose.yml up -d

Usage

Let's start with creating a webhook:

POST http://localhost:9696/api/webhooks
Content-Type: application/json
Authorization: ...

{
  "name": "my-webhook",
  "botToken": "your bot token",
  "private": true,
  "targets": []
}

Now open the Telegram bot with which the webhook is bound and send /subscribe.

tgm-screenshot-1.png

Since this webhook is marked as private, we have to send its nonce which we got in the response.

Well, let's send a message now:

POST http://localhost:9696/<webhook nonce>
Content-Type: application/json

{
  "content": {
    "sources": [
      {
        "type": "REGULAR",
        "value": "Hello, world!",
        "subsources": []
      }
    ]
  }
}

tgm-screenshot-2.png

Authorization

Each request to /api/** path must include a secret key within the Authorization header. See Running for more info.

SDKs

  • wot-client: WoT API client for Kotlin Multiplatform. Currently, WIP.

License

   Copyright 2022 Webhooks over Telegram project contributors

   Licensed under the Apache License, Version 2.0 (the "License");
   you may not use this file except in compliance with the License.
   You may obtain a copy of the License at

       https://www.apache.org/licenses/LICENSE-2.0

   Unless required by applicable law or agreed to in writing, software
   distributed under the License is distributed on an "AS IS" BASIS,
   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   See the License for the specific language governing permissions and
   limitations under the License.

GitHub

https://github.com/d1s-utils/webhooks-over-tgm
You might also like...

Candash - A simple Android app that turns your phone into an instrument cluster for your Tesla Model 3 and Y

Candash - A simple Android app that turns your phone into an instrument cluster for your Tesla Model 3 and Y

What is CANdash? CANdash is an Android app that turns your Android device into a

Aug 11, 2022

android-delicious Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play.

android-delicious Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play.

Delicious Android Delicious Android is an Android app which helps you access and save bookmarks via Delicious. It's available over at Google Play. Fea

May 24, 2022

The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.

The app has got fullscreen Turkey map via Huawei Map. App selects random province and shows it borders on the map than user will try to guess the provinces name.

Il Bil App Introduction I will introduce you to how to implement Account Kit, Map Kit, Game Service. About the game: The app has got fullscreen Turkey

Aug 2, 2022

Sending komq's latest YouTube & Twitch notifications via Twitter.

Komwitter Twitch & YouTube Notification Twitter Bot for komq. Used Libraries: Twitter4J Twitch4J Kotlinx.serialization and some other dependency libra

Feb 10, 2022

This component allows you to interact with remote machine via SSH. You can execute commands or run scripts located on that machine

th2 act ssh (1.2.0) Overview Provides user with the ability to execute specified scripts or commands with the parameter he needs Custom resources for

Mar 18, 2022

Pluck - Pluck, a library helps you to pick image via Galley/Camera built using Compose

Pluck - Pluck, a library helps you to pick image  via Galley/Camera built using Compose

Pluck - The image-picker library for Compose This is an image-picker for your je

Aug 15, 2022

This project consists in the approach of a bakery business, in which the user can book one or more products (cakes), in addition to having the method of payment in cash (post-shipment) or the method of payment via mobile

This project consists in the approach of a bakery business, in which the user can book one or more products (cakes), in addition to having the method of payment in cash (post-shipment) or the method of payment via mobile

Apr 23, 2022

Play casual chess on lichess.org via voice commands

Lichess-by-Voice lichess.org is a cost-free, ad-free chess server. Lichess, as well as this app, is Open Source. The app connects to your Lichess acco

Jul 6, 2022

An android & arduino project. The android app is used to control motors via Arduino.

An android & arduino project. The android app is used to control motors via Arduino.

Boccia ramp project An android & arduino project. The android app is used to control motors via Arduino. Description This project is made in the conte

Jul 29, 2022
A lightweight, feature-rich wrapper for the Telegram Bot API, providing a handy Kotlin DSL to quickly build your bot.

Kotlin Telegram Bot Kotlin based wrapper over Telegram API. Current version of the Telegram Api: 6.0 Principles Annotations Magic. The basic interacti

Jul 22, 2022
Here OneSignal push and in-app-message have been implemented

OneSIgnal demo project Here we have implemented OneSignal inAppMessage and Push Notification ANDROID SDK SETUP WITH ONESIGNAL: https://documentation.o

Dec 7, 2021
Push Notifications Android

Push Notifications Android This repository shows how to use Huawei or Google services for Push-notification in different flavors. Preparations You nee

May 26, 2022
The third-party Telegram android app.
The third-party Telegram android app.

The third-party Telegram android app.

Aug 14, 2022
Telegram messenger for Android

Telegram messenger for Android Telegram is a messaging app with a focus on speed and security. It’s superfast, simple and free. This repo contains the

Aug 9, 2022
Re - Redirect outgoing calls to Signal or Telegram
Re - Redirect outgoing calls to Signal or Telegram

Re Redirect outgoing calls to Signal or Telegram. Tiny app to redirect outgoing

Jul 22, 2022
Redirect outgoing calls to Signal/Telegram/Threema.
Redirect outgoing calls to Signal/Telegram/Threema.

Red Redirect outgoing calls to Signal/Telegram/Threema. Tiny app to redirect outgoing calls to Signal/Telegram/Threema if available. You can cancel re

Jul 22, 2022
Nov 7, 2021
Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications , etc...
Social media app but with new features like translate messages and posts , support video & images as posts  , chat and  notifications , etc...

social-media-app Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications ,

Aug 8, 2022