Skip to content

david-lev/TelegraphSearchBot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

36 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Telegraph Search Bot

Many people use the Telegra.ph platform to write articles and guides In order to get a Instant View in Telegram apps. This bot will let you to give your users a great tool to search among the articles you have created in your telegra.ph account.

  • You can check out our bot here. (The bot and screenshots are in Hebrew but the strings in the source code are in English).

How to config?

  • Clone this repository:
git clone https://github.com/david-lev/TelegraphSearchBot.git
  • Install requirements (pyrogram, telegraph, tgcrypto):
pip3 install -r requirements.txt
  • edit and insert the folowing values into the config file:
[pyrogram]
api_id = 53**5287
api_hash = 1ed3*******0cc7a1ed***fcc77

bot_token = 1463783971:AAGuhvh****C-X**oxvHN**hhyo

[plugins]
root = bot

[telegraph]
access_token = e8200db697*****8c3791296f**0f77c4e5a***2e7e

[telegram]
bot_username = @YourBotUsername

Telegram keys:

  • the api_id & api_hash You can get from my.telegram.org.
  • bot_token & bot_username you can get by create new bot on BotFather.

Telegra.ph Token:

to get access_token for your telegra.ph account go to Telegraph Bot, chosse your account and log into the browser. in the addreess bar click on the lock icon > Cookies > edit.telegra.ph > Cookies > tph_token > Content. here is an example.

Strings

  • You can change the bot view by editing the Strings.py file. You can set an welcome message, channel credit, inline buttons and more. The default is in English but you can change if you want. dont delete the {} characters.
  • There is a string named char_ignore that sets to ignore any post whose title starts with the same character. This way you can hide or create new posts that do not appear in the general search (can be changed at any time.)

How to run?

go to project directory:

cd TelegraphSearchBot

and run it:

python3 main.py