-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcommand.py
More file actions
67 lines (53 loc) · 2.16 KB
/
command.py
File metadata and controls
67 lines (53 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
import telebot
# === CONFIG ===
BOT_TOKEN = "8488169985:AAFZCSr2jG2Z9Xxh6AGrKD0L44rZmkXHfCs" # replace with your Telegram bot token
bot = telebot.TeleBot(BOT_TOKEN)
# Temporary storage for user inputs
user_data = {}
# === Start Command ===
@bot.message_handler(commands=['start'])
def start(message):
bot.reply_to(message, "👋 Hi! welcome to command genrator - by Fire drop ✓ Let's generate your command.\nPlease enter your username:")
user_data[message.chat.id] = {'step': 'username'}
# === Message Handler ===
@bot.message_handler(func=lambda msg: True)
def collect_data(message):
chat_id = message.chat.id
if chat_id not in user_data:
bot.reply_to(message, "Please start with /start")
return
step = user_data[chat_id].get('step')
if step == 'username':
user_data[chat_id]['username'] = message.text
user_data[chat_id]['step'] = 'password'
bot.reply_to(message, "Enter password:")
elif step == 'password':
user_data[chat_id]['password'] = message.text
user_data[chat_id]['step'] = 'target'
bot.reply_to(message, "Enter target:")
elif step == 'target':
user_data[chat_id]['target'] = message.text
user_data[chat_id]['step'] = 'reasons'
bot.reply_to(message, "Enter reasons (comma-separated):")
elif step == 'reasons':
user_data[chat_id]['reasons'] = message.text
user_data[chat_id]['step'] = 'storage'
bot.reply_to(message, "Enter storage-state:")
elif step == 'storage':
user_data[chat_id]['storage'] = message.text
# All data collected
send_final_command(chat_id)
del user_data[chat_id] # reset for next use
def send_final_command(chat_id):
data = user_data[chat_id]
command = f"""python3 rep.py \\
--username "{data['username']}" \\
--password "{data['password']}" \\
--target "{data['target']}" \\
--reasons "{data['reasons']}" \\
--storage-state "{data['storage']}" \\
--headless True"""
bot.send_message(chat_id, "✅ Your generated command:\n\n" + f"```\n{command}\n```", parse_mode="Markdown")
# === Run Bot ===
print("🤖 Bot is running...")
bot.infinity_polling()