🤖✨Create Your Own Telegram Filter Bot | Easy Tutorial for Beginners 🌟 | @TraxDinosaur

 

 

 

Telegram Filter Bot

 






 Code:
'''
TELEGRAM FILTER BOT TUTORIAL
GitHub: TraxDinosaur
Replit: TraxDinosaur
Instagram: @TraxDinosaur
YouTube: @TraxDinosaur
Blogger: TraxDinosaurs
'''
import logging
from telegram import Update
from telegram.ext import ApplicationBuilder, ContextTypes, CommandHandler, MessageHandler, filters
logging.basicConfig(
format='%(asctime)s - %(name)s - %(levelname)s - %(message)s',
level=logging.INFO
)
async def start(update:Update, context:ContextTypes.DEFAULT_TYPE):
await context.bot.send_message(chat_id=update.effective_chat.id,text="This Is TraxDinosaur")
async def send_hello(update:Update, context:ContextTypes.DEFAULT_TYPE):
await update.message.reply_text("Heyy Welcome Here!") # It will send this string to user.
print("Bot Is Working")
app = ApplicationBuilder().token("YOUR_BOT_TOKEN").build()
start_handler = CommandHandler('start', start)
app.add_handler(start_handler)
hello_handler = MessageHandler(filters.Regex(r'hi'),send_hello) # When User Will Send hi in Chat
app.add_handler(hello_handler)
app.run_polling()
view raw FilterBot.py hosted with ❤ by GitHub
 



Post a Comment

0 Comments