Skip to content

Instantly share code, notes, and snippets.

@WeslenPy
Created June 23, 2025 20:59
Show Gist options
  • Select an option

  • Save WeslenPy/05a5efd47a8fb834d6bd148699ea01af to your computer and use it in GitHub Desktop.

Select an option

Save WeslenPy/05a5efd47a8fb834d6bd148699ea01af to your computer and use it in GitHub Desktop.
bot
TELEGRAM_BOT_TOKEN="SEU_TOKEN_DO_BOT_AQUI"
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)
pyTelegramBotAPI
python-dotenv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment