freetrialtrial43/OMOR57VoteBotPublic · Bot Template
AIThis bot is written in Python using the python-telegram-bot library and integrates with the 1secmail API to generate temporary email addresses. It includes functions to fetch disposable email domains, create random usernames, and check for incoming messages. The /start command sends a welcome message in Bengali telling users to type /new to create a temporary email.
Utilitytemp-mailpythontelegram-bot1secmailutilitynot_tbl
1 commands0 envUpdated 4d agoCreated Jul 29, 2026
commands/_start.js
javascript · 144 lines
1/**#command2name: /start3answer: আমি omor এর তৈরিকৃত একটি bot আপনাকে কিভাবে সাহায্য করতে পারি4keyboard: 5parse_mode: markdown6aliases: 7allow_only_group: false8need_reply: true9is_web: 110#command**/11 12import requests13import random14import string15from telegram import Update16from telegram.ext import (17 Application,18 CommandHandler,19 ContextTypes20)21 22from config import BOT_TOKEN23 24 25BASE_URL = "https://www.1secmail.com/api/v1/"26 27 28def random_username(length=10):29 return ''.join(30 random.choices(31 string.ascii_lowercase + string.digits,32 k=length33 )34 )35 36 37def get_domains():38 try:39 r = requests.get(40 f"{BASE_URL}?action=getDomainList",41 timeout=1042 )43 return r.json()44 except:45 return ["1secmail.com"]46 47 48def get_messages(login, domain):49 try:50 r = requests.get(51 f"{BASE_URL}?action=getMessages&login={login}&domain={domain}",52 timeout=1053 )54 return r.json()55 except:56 return []57 58 59async def start(update: Update, context: ContextTypes.DEFAULT_TYPE):60 await update.message.reply_text(61 "📧 Temp Mail Bot\n\n"62 "নতুন Temporary Email তৈরি করতে /new লিখুন"63 )64 65 66async def new_mail(update: Update, context: ContextTypes.DEFAULT_TYPE):67 68 domain = random.choice(get_domains())69 username = random_username()70 71 email = f"{username}@{domain}"72 73 context.user_data["email"] = email74 context.user_data["login"] = username75 context.user_data["domain"] = domain76 77 78 await update.message.reply_text(79 f"✅ আপনার Temporary Email:\n\n"80 f"`{email}`\n\n"81 f"📥 মেইল দেখতে /inbox লিখুন",82 parse_mode="Markdown"83 )84 85 86async def inbox(update: Update, context: ContextTypes.DEFAULT_TYPE):87 88 if "email" not in context.user_data:89 await update.message.reply_text(90 "আগে /new দিয়ে Email তৈরি করুন"91 )92 return93 94 95 login = context.user_data["login"]96 domain = context.user_data["domain"]97 98 messages = get_messages(login, domain)99 100 if not messages:101 await update.message.reply_text(102 "📭 এখনো কোনো মেইল আসেনি"103 )104 return105 106 107 text = "📩 Inbox:\n\n"108 109 for msg in messages:110 text += (111 f"From: {msg.get('from')}\n"112 f"Subject: {msg.get('subject')}\n\n"113 )114 115 116 await update.message.reply_text(text)117 118 119def main():120 121 app = Application.builder().token(122 BOT_TOKEN https://console.telebothost.com/#botdash/451996717886301/tab/commands123 ).build()124 125 126 app.add_handler(127 CommandHandler("start", start)128 )129 130 app.add_handler(131 CommandHandler("new", new_mail)132 )133 134 app.add_handler(135 CommandHandler("inbox", inbox)136 )137 138 139 print("Bot Running...")140 app.run_polling()141 142 143if __name__ == "__main__":144 main()