Run Telegram Bot on Raspberry Pi 🤖
Learn how to use the Telegram Bot, host a Telegram Bot on  your Raspberry Pi, and use the messaging app to interact with  your device.
Step 1: Open Telegram app in your system or mobile
1.1 Open Telegram app in your system or mobile
Download from here: Telegram1.2 Start "BotFather"
![Screenshot_2017-01-04-23-01-23.png](https://hackster.imgix.net/uploads/attachments/247635/screenshot_2017-01-04-23-01-23_sAfa0Kj97Q.png?auto=compress%2Cformat&w=740&h=555&fit=max)
1.3 Open "BotFather"
![Screenshot_2017-01-04-23-03-02.png](https://hackster.imgix.net/uploads/attachments/247636/screenshot_2017-01-04-23-03-02_UJXUYSGb4B.png?auto=compress%2Cformat&w=740&h=555&fit=max)
1.4 Start "BotFather"
![Screenshot_2017-01-04-23-04-26.png](https://hackster.imgix.net/uploads/attachments/247637/screenshot_2017-01-04-23-04-26_U4Y14rhuW1.png?auto=compress%2Cformat&w=740&h=555&fit=max)
1.5 Create a new Bot
![Screenshot_2017-01-04-23-05-28.png](https://hackster.imgix.net/uploads/attachments/247638/screenshot_2017-01-04-23-05-28_83C81SBskz.png?auto=compress%2Cformat&w=740&h=555&fit=max)
Add an imageDelete this imageBot: Salmanfaris_bot1.6 Obtain access token
![Screenshot_2017-01-04-23-05-41.png](https://hackster.imgix.net/uploads/attachments/247640/screenshot_2017-01-04-23-05-41_ll1lox3lZ5.png?auto=compress%2Cformat&w=740&h=555&fit=max)
Step 2: Setup Raspberry Pi
For detailed Raspberry click here.Note: If you already set the Pi then skip this section.
Step 3: Install TelegramBot on Raspberry Pi
3.1 Open Putty
3.2 Connect Pi via SSH
3.3 Install  "Python Package Index"
sudo apt-get install python-pip
Note: Make sure Pi has internet access
3.4 Install "telepot"
sudo pip install telepot
Step 4: Run the Python Code
4.1 Â Clone the git
git clone https://github.com/salmanfarisvp/TelegramBot.git
4.2 Paste your Bot Token here
bot = telepot.Bot('Bot Token')
Note: 1.6 for more details4.3 Run the Code
python telegrambot.py
All set, now time to connect the Pi and LED.
Step 5: Connect LED to Pi
Step 6: Send Command
6.1 Start our Bot
![Screenshot_2017-01-04-23-44-12.png](https://hackster.imgix.net/uploads/attachments/247649/screenshot_2017-01-04-23-44-12_QEgxuLzN1g.png?auto=compress%2Cformat&w=740&h=555&fit=max)
![Screenshot_2017-01-04-23-44-46.png](https://hackster.imgix.net/uploads/attachments/247650/screenshot_2017-01-04-23-44-46_DLm5lgfeyw.png?auto=compress%2Cformat&w=740&h=555&fit=max)
6.2 Send "on" & "off"
![Screenshot_2017-01-05-00-03-52.png](https://hackster.imgix.net/uploads/attachments/247651/screenshot_2017-01-05-00-03-52_qaqwfc721W.png?auto=compress%2Cformat&w=740&h=555&fit=max)
![Screenshot_2017-01-05-00-04-18.png](https://hackster.imgix.net/uploads/attachments/247652/screenshot_2017-01-05-00-04-18_HiB24Wl96H.png?auto=compress%2Cformat&w=740&h=555&fit=max)
Look at your Pi, you can see the LED on and off when you send "on" and "off" to our bot. Thank You!