fork para inversionitas con bot simple
This commit is contained in:
15
app/telegrambot.py
Normal file
15
app/telegrambot.py
Normal file
@ -0,0 +1,15 @@
|
||||
from telegram import Bot
|
||||
import asyncio
|
||||
|
||||
# Configura tu bot con el token de BotFather
|
||||
TOKEN = "7626026035:AAHEMp_iIN3y8AwywL0R6OTQvNi7EcJZ0iY"
|
||||
CHAT_ID = "-123456789" # Reemplaza con el ID del grupo
|
||||
|
||||
bot = Bot(token=TOKEN)
|
||||
|
||||
async def enviar_mensaje(mensaje: str):
|
||||
await bot.send_message(chat_id=CHAT_ID, text=mensaje)
|
||||
|
||||
# Para ejecutar la función de forma síncrona cuando sea necesario
|
||||
def enviar_mensaje_sync(mensaje: str):
|
||||
asyncio.run(enviar_mensaje(mensaje))
|
Reference in New Issue
Block a user