This is a bridge between Flarum Webhooks extension and Telegram.
-
Follow the instructions to create a Telegram bot.
-
Invite the bot to the room where you want it to post and obtain the room id.
-
Clone this repository somewhere (e.g. into your Flarum installation’s
public/
directory). -
Run
composer install
in the directory to install dependencies. -
Create
config.php
file in the directory, containing:<?php return [ 'apiKey' => 'your-api-key', 'botName' => 'your-bot-name', 'chatId' => 'your-chat-id', 'token' => 'your-random-string', ];
-
Replace
your-bot-name
with the bot’s username,your-api-key
with the “token to access the HTTP API” you received from BotFather,your-chat-id
with the id of the room id andyour-random-string
with random string. -
In the “FoF Webhooks” section of the Flarum admin panel add a webhook for “Slack” and set the URL to the location where you installed this project and pass
action=hook
andtoken=your-random-string
in the query string (e.g.https://your-flarum-forum.com/flarum-webhooks-telegram-bridge/?action=hook&token=your-random-string
)
Please see the LICENSE included in this repository for a full copy of the MIT license, which this project is licensed under.