-
-
Save WeslenPy/05a5efd47a8fb834d6bd148699ea01af to your computer and use it in GitHub Desktop.
bot
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| TELEGRAM_BOT_TOKEN="SEU_TOKEN_DO_BOT_AQUI" | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import os | |
| import telebot | |
| import smtplib | |
| import logging | |
| from dotenv import load_dotenv | |
| load_dotenv() | |
| TOKEN = os.getenv('TELEGRAM_BOT_TOKEN') | |
| if not TOKEN: | |
| exit() | |
| bot = telebot.TeleBot(TOKEN) | |
| def verificar_email_senha(email, senha): | |
| try: | |
| with smtplib.SMTP_SSL('smtp.gmail.com', 465) as server: | |
| server.login(email, senha) | |
| return True | |
| except smtplib.SMTPAuthenticationError: | |
| return False | |
| except Exception as e: | |
| return False | |
| @bot.message_handler(func=lambda message: True) | |
| def processar_mensagem(message): | |
| texto = message.text | |
| if "|" in texto: | |
| try: | |
| email, senha = texto.split("|", 1) | |
| email = email.strip() | |
| senha = senha.strip() | |
| if not email or not senha: | |
| bot.reply_to(message, "❌ Email ou senha não podem ser vazios.") | |
| return | |
| bot.reply_to(message, "Verificando login...") | |
| valido = verificar_email_senha(email, senha) | |
| if valido: | |
| bot.reply_to(message, "✅ Login VÁLIDO!") | |
| else: | |
| bot.reply_to(message, "❌ Login INVÁLIDO.") | |
| except ValueError: | |
| bot.reply_to(message, "Formato inválido. Envie no formato: email@exemplo.com|senha123") | |
| except Exception as e: | |
| bot.reply_to(message, "Ocorreu um erro ao processar sua solicitação.") | |
| else: | |
| bot.reply_to(message, "Envie no formato: email@exemplo.com|senha123") | |
| bot.polling(none_stop=True) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| pyTelegramBotAPI | |
| python-dotenv | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment