File size: 604 Bytes
e806155
 
2bd153a
 
 
884c185
 
e806155
 
884c185
e806155
 
 
 
884c185
e806155
 
f7b36ee
e806155
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from telegram import Update
from telegram.ext import ApplicationBuilder, CommandHandler, MessageHandler, ContextTypes, filters
import os

TOKEN = os.environ.get("TELEGRAM_TOKEN")


async def responder(update: Update, context: ContextTypes.DEFAULT_TYPE):
    msg = update.message.text.lower()

    if msg == "oi":
        await update.message.reply_text("Oi! Tudo bem?")
    else:
        await update.message.reply_text("Não entendi, mas estou funcionando!")

app = ApplicationBuilder().token(TOKEN).build()
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, responder))

app.run_polling()