informatica:programacion:python:modulos:python-telegram-bot
Diferencias
Muestra las diferencias entre dos versiones de la página.
| Ambos lados, revisión anteriorRevisión previaPróxima revisión | Revisión previa | ||
| informatica:programacion:python:modulos:python-telegram-bot [2021/02/18 20:33] – [Fotos] tempwin | informatica:programacion:python:modulos:python-telegram-bot [2021/06/23 11:28] (actual) – [Python: python-telegram-bot] tempwin | ||
|---|---|---|---|
| Línea 5: | Línea 5: | ||
| * [[https:// | * [[https:// | ||
| * [[https:// | * [[https:// | ||
| + | |||
| + | ===== Instalación ===== | ||
| + | |||
| + | Se puede instalar a través del gestor de módulos de Python '' | ||
| + | |||
| + | < | ||
| + | pip install python-telegram-bot | ||
| + | </ | ||
| + | ===== Hola, mundo ===== | ||
| + | |||
| + | Ejemplo de código que responde al texto ''/ | ||
| + | |||
| + | <code python> | ||
| + | from telegram import Update | ||
| + | from telegram.ext import Updater, CommandHandler, | ||
| + | |||
| + | BOT_TOKEN = " | ||
| + | |||
| + | |||
| + | def hello(update: | ||
| + | update.message.reply_text(f' | ||
| + | |||
| + | updater = Updater(BOT_TOKEN) | ||
| + | |||
| + | updater.dispatcher.add_handler(CommandHandler(' | ||
| + | |||
| + | updater.start_polling() | ||
| + | updater.idle() | ||
| + | </ | ||
| ===== HTML ===== | ===== HTML ===== | ||
informatica/programacion/python/modulos/python-telegram-bot.1613676809.txt.gz · Última modificación: por tempwin
