Lightweight binary Matrix appservice that reposts messages from a Matrix room to a Telegram channel using Telegram Bot API. Perfect for announcements read-only Matrix rooms.
- TypeScript 96.3%
- JavaScript 3.7%
| .vscode | ||
| src | ||
| .env.example | ||
| .gitignore | ||
| .prettierrc | ||
| bun.lock | ||
| eslint.config.js | ||
| LICENSE | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
M2TG
Lightweight binary Matrix appservice that reposts messages from a Matrix room to a Telegram channel using Telegram Bot API. Perfect for announcements read-only Matrix rooms.
Registration file:
id: m2tg
url: http://localhost:PORT
as_token: APP_SERVICE_TOKEN
hs_token: HOMESERVER_TOKEN
sender_localpart: m2tg
namespaces:
users:
- exclusive: false
regex: "@.*:.*"
aliases: []
rooms: []
rate_limited: false
Environment variables:
# Full url
HOMESERVER_URL=""
# Not alias, internal room id
ROOM_ID=""
# Port for M2tg to work on
PORT=""
# Any random 64+ character strings
APP_SERVICE_TOKEN=""
HOMESERVER_TOKEN=""
# @botfather
TELEGRAM_CHAT_ID=""
TELEGRAM_BOT_TOKEN=""
Usage
Download a binary or build yourself.
Build
Bun is required.
- Clone repository
- Install dependencies:
bun ci
- To run a dev server:
bun src/index.ts - To build a binary for your platform:
bun run build - To build all binaries for all platforms:
bun run crossbuild
Medias sent together in a short time window (less than 5 seconds apart) are grouped and sent in a single gallery message to Telegram.