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

Overview

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.
You might also like...
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

A repository that contains various examples of how to use the telegram-bot library.

Telegram-bot templates This repository contains simple different examples of how to use the telegram-bot library. How to use All the examples are conv

AlarmIT is a simple alarm app. The alarms can be turned off via three methods - normal turnoff, by shaking the device a number of times, by solving maths questions.
AlarmIT is a simple alarm app. The alarms can be turned off via three methods - normal turnoff, by shaking the device a number of times, by solving maths questions.

Kicking Off Hacktoberfest with ACM-VIT! AlarmIT AlarmIT is a simple alarm app. The alarms can be turned off via three methods - normal turnoff, by sha

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

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

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

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

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

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

Comments
  • Migrate to Ktor

    Migrate to Ktor

    To increase project's build times, performance, development convenience, I want to migrate the project to Ktor framework with the following stack:

    • Web Framework: Ktor
    • ORM: Ktorm
    • CP: Hikari
    • DI: PopKorn

    The API won't change

    improvement 
    opened by d1snin 0
Releases(1.1.0)
  • 1.1.0(Aug 4, 2022)

    1.1.0 version release of Webhooks over Telegram

    What's Changed

    • Implemented wot-client-starter by @d1snin in https://github.com/d1s-utils/webhooks-over-tgm/pull/8

    Full Changelog: https://github.com/d1s-utils/webhooks-over-tgm/compare/1.0.1...1.1.0

    Source code(tar.gz)
    Source code(zip)
  • 1.0.1(Aug 4, 2022)

Owner
d1s utils
A single space for my pet projects.
d1s utils
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

Jey 61 Dec 27, 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

Fakhrul Alam Siddiqei 2 Dec 7, 2022
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

MobileUp 3 Oct 3, 2022
Simple Telegram bot that responds with list of results obtained from Google.

Simple project focused on learning a little more about how Telegram bots work and are created. The bot has a very basic functionality: the user types

Jesus Ericks 3 Nov 13, 2022
Olalekan Fagbemi 0 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 Social media app but with new features like translate messages and posts , support video & images as posts , chat and notifications ,

Kareem Aboelatta 15 Dec 13, 2022
The third-party Telegram android app.

The third-party Telegram android app.

NekoX Dev 3.5k Jan 8, 2023
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

DrKLO 21.3k Jan 1, 2023
Re - Redirect outgoing calls to Signal or Telegram

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

lucky 26 Oct 8, 2022