Aprender a crear y alojar un bot de Telegram en una Raspberry Pi es una tarea bastante sencilla que no te tomará más de unos cuantos minutos.
Paso 1: abre la aplicación Telegram en tu sistema o móvil
Abrir la aplicación Telegram en su sistema o dispositivo móvil
![](https://technetters.com/content/images/2021/07/telegram-aplicacion.jpg)
Busca el creador de bots llamado "BotFather"
![](https://technetters.com/content/images/2021/07/telegram-botfather.jpg)
Inicia BotFather para empezar a crear tu bot
![](https://technetters.com/content/images/2021/07/telegram-botfather-2.jpg)
Ahora crea un nuevo bot
![](https://technetters.com/content/images/2021/07/telegram-botfather-3.jpg)
Guarda tu nueva clave de acceso
![](https://technetters.com/content/images/2021/07/telegram-botfather-4.jpg)
Paso 2: Configurar Raspberry Pi y Instalar TelegramBot
Accede a tu Raspberry desde Putty
![](https://technetters.com/content/images/2021/07/raspberry-pi-putty.jpg)
Conéctate vía SSH a la Raspberry Pi
![](https://technetters.com/content/images/2021/07/raspberry-pi-putty-2.jpg)
Instalamos los paquetes de Python
sudo apt-get install python-pip
![](https://technetters.com/content/images/2021/07/raspberry-pi-python.jpg)
Información: Asegúrate de que tu Raspberry tiene acceso a internet
![](https://technetters.com/content/images/2021/07/raspberry-pi-python-2.jpg)
Ahora procedemos a instalar telepot
sudo pip install telepot
Paso 4: Ejecutar el código de Python
Obtenemos los archivos de GitHub mediante el siguiente comando:
git clone https://github.com/salmanfarisvp/TelegramBot.git
Introduce la clave de acceso del bot que has creado
bot = telepot.Bot('Bot Token')
Acto seguido ejecutamos el bot en Python
python telegrambot.py
La parte difícil ya está completada, ahora toca la Raspberry y los LED.
Paso 5: Conectar los LED a la Raspberry Pi
![](https://technetters.com/content/images/2021/07/raspberry-pi-python-3.jpg)
Paso 6: Enviando un comando al bot
Primero, iniciamos nuestro nuevo bot
![](https://technetters.com/content/images/2021/07/raspberry-pi-python-4.jpg)
Probamos a encender y apagar el bot
![](https://technetters.com/content/images/2021/07/raspberry-pi-telegram.jpg)
Cuando escribas estos comandos, vigila tu Raspberry Pi y si las luces LED se encienden y se apagan, significa que ya tienes tu bot de Telegram conectado a tu Raspberry Pi utilizando Python.