A bot to forward Facebook page updates to a Telegram channel.
This bot is written in Python and uses the python-telegram-bot wrapper for the Telegram Bot API and the facebook-sdk client library for the Facebook Graph API.
fbpages-telegram-bot uses Python 3 (developed and tested with version 3.6.0), which can be downloaded here if you are running Windows, or by installing the python3
package with your package manager if you're running Linux.
sudo apt-get install python3 -y
You'll also need the following packages:
python-telegram-bot
facebook-sdk
youtube-dl
These can all be installed with:
pip3 install python-telegram-bot, facebook-sdk, youtube-dl
on both Windows's Command Prompt and Linux's terminal.
To get started with the bot itself:
https://api.telegram.org/bot<BOTID>/getUpdates
to find your user_id
or chat_id
to use in the settings file.Get Token
, Get App Token
. The Access Token
field will now have the token required for the Facebook section of the settings file.git clone https://github.com/s1cp/fbpages-telegram-bot.git
cd fbpages-telegram-bot
botsettings.ini
. Use example.botsettings.ini
as an example with cp example.botsettings.ini botsettings.ini && nano botsettings.ini
.python3 facebook2telegram.py
Name | Description |
---|---|
locale |
Facebook locale. Format example: en-US |
token |
Facebook Graph API token. |
pages |
List of page IDs. Format example: ['123456789',pageusername'] |
refreshrate |
Time interval between every Facebook check, in seconds. |
status |
Allow status posts. Format: True or False |
photo |
Allow photo posts. Format: True or False |
video |
Allow video posts. Format: True or False |
link |
Allow link posts. Format: True or False |
shared |
Allow shared posts. Format: True or False |
message |
Allow message in posts. Format: True or False |
Name | Description |
---|---|
token |
Telegram Bot API token. |
channel |
Username of the channel that will receive the posts |
admin |
Optional. Bot creator's ID to receive the bot's status. |