Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python3
- from telegram import Update
- from telegram.ext import ApplicationBuilder, MessageHandler, filters, ContextTypes
- # @sreda_banner_bot
- API_TOKEN =
- async def delete_casino_messages(update: Update, context: ContextTypes.DEFAULT_TYPE) -> None:
- txt = update.message.text.lower()
- for w in [
- 'казик', 'казино', 'casino',
- 'казинобот', 'казинобота',
- 'bonus',
- 'uнтuм', 'интим',
- ]:
- if txt.startswith(w) or txt.endswith(w) or f' {w} ' in txt:
- await update.message.delete()
- break
- def main():
- app = ApplicationBuilder().token(API_TOKEN).build()
- app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, delete_casino_messages))
- app.run_polling()
- if __name__ == '__main__':
- main()
Advertisement
Add Comment
Please, Sign In to add comment