-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtgnc2.py
More file actions
389 lines (341 loc) · 13.7 KB
/
tgnc2.py
File metadata and controls
389 lines (341 loc) · 13.7 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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
import asyncio, json, os, random, time
from functools import wraps
from telegram import Update
from telegram.ext import Application, CommandHandler, ContextTypes, MessageHandler, filters
import logging
# ---------------------------
# CONFIG
# ---------------------------
TOKENS = [
"8241984927:AAEx81eBOey6hFSd2vFgh-Lb8rDjkZ1VLTk",
"8211968285:AAFP-PGaLdWA_SwQZwKgym_TPAG7mFZmuo4",
"8230761403:AAFxMji_TzSFARHWKqeqJ0CuAsMN0m_GBAU",
"7744648275:AAGXjxtPfQJrnTFNjTS-2XUJMoPe9-rjVwg",
"8414075744:AAFhRBy8BUAudqTxaeiVOtWuxu7bWtbqcWg",
"YOUR_BOT_TOKEN_6",
"YOUR_BOT_TOKEN_7",
"YOUR_BOT_TOKEN_8",
"YOUR_BOT_TOKEN_9",
"YOUR_BOT_TOKEN_10",
]
# Your main admin / owner Telegram ID (already correct as you said)
OWNER_ID = 6940098775
SUDO_FILE = "sudo.json"
# ---------------------------
# RAID TEXTS
# ---------------------------
RAID_TEXTS = [
"Try ben ci भोसड़ी beta",
"😂😂😂😂Try ma randy 😂😂😂😂",
"Teri mom ko i love u ree😆💔🖕🏽",
"Tmkc pe chppl hi chppl marunga !!🔥😂🩴",
"😉😈🔥هههههههههههههه Teri maa रंडी",
"𝐂ʜʟ 𝐇ᴀʀᴍᴢᴀᴅ𝐈 𝐊ᴇ लड़के 💛🤍🩵",
"hlw hlw mja aarha cudne me?",
"bina ruke thukai hogi teri",
"kr na fyt",
"hlw reply fas",
"sort nhi krunga cud tu bina ruke",
"काले Doraemon रोता reh",
"teri bkc me bigboss",
"Awaz neeche rndy k bacche",
"Sawal mt puch tery ma k bosda baap mhu",
]
# ---------------------------
# NCEMO EMOJIS
# ---------------------------
NCEMO_EMOJIS = [
"😋","😝","😜","🤪","😑","🤫","🤭","🥱","🤗","😡","😠","😤",
"😮💨","🙄","😒","🥶","🥵","🤢","😎","🥸",
"😹","💫","😼","😽","🙀","😿","😾",
"🙈","🙉","🙊",
"⭐","🌟","✨","⚡","💥","💨",
"💛","💙","💜","🤎","🤍","💘","💝"
]
# ---------------------------
# GLOBAL STATE
# ---------------------------
# Load SUDO users, always make sure OWNER is included
if os.path.exists(SUDO_FILE):
try:
with open(SUDO_FILE, "r") as f:
_loaded = json.load(f)
SUDO_USERS = set(int(x) for x in _loaded)
except Exception:
SUDO_USERS = set()
else:
SUDO_USERS = set()
SUDO_USERS.add(OWNER_ID) # owner is always sudo
with open(SUDO_FILE, "w") as f:
json.dump(list(SUDO_USERS), f)
def save_sudo():
with open(SUDO_FILE, "w") as f:
json.dump(list(SUDO_USERS), f)
group_tasks = {} # {chat_id: {bot_id: task}}
slide_targets = set() # user_ids
slidespam_targets = set()
swipe_mode = {} # {chat_id: name}
apps, bots = [], []
delay = 1
logging.basicConfig(level=logging.INFO)
# ---------------------------
# DECORATORS
# ---------------------------
def only_sudo(func):
@wraps(func)
async def wrapper(update: Update, context: ContextTypes.DEFAULT_TYPE):
uid = update.effective_user.id
if uid not in SUDO_USERS:
return await update.message.reply_text("❌ BAP KA BOT USE KR RHA JAKE PERMISSION LE PHELE .")
return await func(update, context)
return wrapper
def only_owner(func):
@wraps(func)
async def wrapper(update: Update, context: ContextTypes.DEFAULT_TYPE):
uid = update.effective_user.id
if uid != OWNER_ID:
return await update.message.reply_text("❌ TERA BAP HI KR SKTA HAI YE .")
return await func(update, context)
return wrapper
# ---------------------------
# LOOP FUNCTION
# ---------------------------
async def bot_loop(bot, chat_id, base, mode):
i = 0
while True:
try:
if mode == "raid":
text = f"{base} {RAID_TEXTS[i % len(RAID_TEXTS)]}"
else:
text = f"{base} {NCEMO_EMOJIS[i % len(NCEMO_EMOJIS)]}"
await bot.set_chat_title(chat_id, text)
i += 1
await asyncio.sleep(delay)
except Exception as e:
print(f"[WARN] Bot error in chat {chat_id}: {e}")
await asyncio.sleep(2)
# ---------------------------
# COMMANDS
# ---------------------------
async def start_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text("💗 Welcome to FIRE DROP Telegram Nc Bot!\nUse /help to see all commands.")
async def help_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text(
" Chudai Menu\n\n"
"⚡ GC Loops:\n"
"/gcnc <text>\n/ncemo <text>\n/stopgcnc\n/stopall\n/delay <sec>\n/status\n\n"
"🎯 Slide & Spam:\n"
"/targetslide (reply)\n/stopslide (reply)\n/slidespam (reply)\n/stopslidespam (reply)\n\n"
"⚡ Swipe Mode:\n"
"/swipe <name>\n/stopswipe\n\n"
"👑 SUDO Management:\n"
"/addsudo (reply or /addsudo <id>)\n"
"/delsudo (reply or /delsudo <id>)\n"
"/listsudo\n\n"
"🛠 Misc:\n/myid\n/ping"
)
async def ping_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE):
start_time = time.time()
msg = await update.message.reply_text("🏓 Pinging...")
end_time = time.time()
latency = int((end_time - start_time) * 1000)
await msg.edit_text(f"🏓 Pong! ✅ {latency} ms")
async def myid(update: Update, context: ContextTypes.DEFAULT_TYPE):
await update.message.reply_text(f"🆔 Your ID: {update.effective_user.id}")
# --- GC Loops ---
@only_sudo
async def gcnc(update: Update, context: ContextTypes.DEFAULT_TYPE):
if not context.args:
return await update.message.reply_text("⚠️ Usage: /gcnc <text>")
base = " ".join(context.args)
chat_id = update.message.chat_id
group_tasks.setdefault(chat_id, {})
for bot in bots:
if bot.id not in group_tasks[chat_id]:
task = asyncio.create_task(bot_loop(bot, chat_id, base, "raid"))
group_tasks[chat_id][bot.id] = task
await update.message.reply_text(" 🫴😹 GC name loop started with raid texts.")
@only_sudo
async def ncemo(update: Update, context: ContextTypes.DEFAULT_TYPE):
if not context.args:
return await update.message.reply_text("⚠️ Usage: /ncemo <text>")
base = " ".join(context.args)
chat_id = update.message.chat_id
group_tasks.setdefault(chat_id, {})
for bot in bots:
if bot.id not in group_tasks[chat_id]:
task = asyncio.create_task(bot_loop(bot, chat_id, base, "emoji"))
group_tasks[chat_id][bot.id] = task
await update.message.reply_text("🔄 Emoji loop started with all bots.")
@only_sudo
async def stopgcnc(update: Update, context: ContextTypes.DEFAULT_TYPE):
chat_id = update.message.chat_id
if chat_id in group_tasks:
for task in group_tasks[chat_id].values():
task.cancel()
group_tasks[chat_id] = {}
await update.message.reply_text(" 🖕👌Loop stopped in this GC.")
@only_sudo
async def stopall(update: Update, context: ContextTypes.DEFAULT_TYPE):
for chat_id in list(group_tasks.keys()):
for task in group_tasks[chat_id].values():
task.cancel()
group_tasks[chat_id] = {}
await update.message.reply_text(" 🫦 All loops stopped.")
@only_sudo
async def delay_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE):
global delay
if not context.args:
return await update.message.reply_text(f"⏱ Current delay: {delay}s")
try:
delay = max(0.5, float(context.args[0]))
await update.message.reply_text(f"✅ Delay set to {delay}s")
except:
await update.message.reply_text("⚠️ Invalid number.")
@only_sudo
async def status_cmd(update: Update, context: ContextTypes.DEFAULT_TYPE):
msg = "📊 Active Loops:\n"
for chat_id, tasks in group_tasks.items():
msg += f"Chat {chat_id}: {len(tasks)} bots running\n"
await update.message.reply_text(msg)
# --- SUDO ---
@only_owner
async def addsudo(update: Update, context: ContextTypes.DEFAULT_TYPE):
uid = None
# Method 1: reply to user
if update.message.reply_to_message:
uid = update.message.reply_to_message.from_user.id
# Method 2: /addsudo <id>
elif context.args:
try:
uid = int(context.args[0])
except ValueError:
uid = None
if not uid:
return await update.message.reply_text(
"⚠️ Reply to a user's message OR use:\n/addsudo <telegram_id>"
)
SUDO_USERS.add(uid)
save_sudo()
await update.message.reply_text(f"✅ {uid} added as sudo.")
@only_owner
async def delsudo(update: Update, context: ContextTypes.DEFAULT_TYPE):
uid = None
# Method 1: reply to user
if update.message.reply_to_message:
uid = update.message.reply_to_message.from_user.id
# Method 2: /delsudo <id>
elif context.args:
try:
uid = int(context.args[0])
except ValueError:
uid = None
if not uid:
return await update.message.reply_text(
"⚠️ Reply to a sudo user's message OR use:\n/delsudo <telegram_id>"
)
if uid == OWNER_ID:
return await update.message.reply_text("❌ Can't remove OWNER from sudo.")
if uid in SUDO_USERS:
SUDO_USERS.remove(uid)
save_sudo()
await update.message.reply_text(f"🗑 {uid} removed from sudo.")
else:
await update.message.reply_text("⚠️ This user is not in sudo list.")
@only_sudo
async def listsudo(update: Update, context: ContextTypes.DEFAULT_TYPE):
text = "👑 SUDO USERS:\n" + "\n".join(map(str, sorted(SUDO_USERS)))
await update.message.reply_text(text)
# --- Slide / Spam / Swipe ---
@only_sudo
async def targetslide(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.reply_to_message:
slide_targets.add(update.message.reply_to_message.from_user.id)
await update.message.reply_text("🎯 Target slide added.")
@only_sudo
async def stopslide(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.reply_to_message:
uid = update.message.reply_to_message.from_user.id
slide_targets.discard(uid)
await update.message.reply_text("🛑 Target slide stopped.")
@only_sudo
async def slidespam(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.reply_to_message:
slidespam_targets.add(update.message.reply_to_message.from_user.id)
await update.message.reply_text("💥 Slide spam started.")
@only_sudo
async def stopslidespam(update: Update, context: ContextTypes.DEFAULT_TYPE):
if update.message.reply_to_message:
slidespam_targets.discard(update.message.reply_to_message.from_user.id)
await update.message.reply_text("🛑 Slide spam stopped.")
@only_sudo
async def swipe(update: Update, context: ContextTypes.DEFAULT_TYPE):
if not context.args:
return await update.message.reply_text("⚠️ Usage: /swipe <name>")
swipe_mode[update.message.chat_id] = " ".join(context.args)
await update.message.reply_text(f"⚡ Swipe mode ON with name: {swipe_mode[update.message.chat_id]}")
@only_sudo
async def stopswipe(update: Update, context: ContextTypes.DEFAULT_TYPE):
swipe_mode.pop(update.message.chat_id, None)
await update.message.reply_text("🛑 Swipe mode stopped.")
# --- Auto Replies ---
async def auto_replies(update: Update, context: ContextTypes.DEFAULT_TYPE):
uid, chat_id = update.message.from_user.id, update.message.chat_id
if uid in slide_targets:
for text in RAID_TEXTS:
await update.message.reply_text(text)
if uid in slidespam_targets:
for text in RAID_TEXTS:
await update.message.reply_text(text)
if chat_id in swipe_mode:
for text in RAID_TEXTS:
await update.message.reply_text(f"{swipe_mode[chat_id]} {text}")
# ---------------------------
# BUILD APP & RUN
# ---------------------------
def build_app(token):
app = Application.builder().token(token).build()
app.add_handler(CommandHandler("start", start_cmd))
app.add_handler(CommandHandler("help", help_cmd))
app.add_handler(CommandHandler("ping", ping_cmd))
app.add_handler(CommandHandler("myid", myid))
app.add_handler(CommandHandler("gcnc", gcnc))
app.add_handler(CommandHandler("ncemo", ncemo))
app.add_handler(CommandHandler("stopgcnc", stopgcnc))
app.add_handler(CommandHandler("stopall", stopall))
app.add_handler(CommandHandler("delay", delay_cmd))
app.add_handler(CommandHandler("status", status_cmd))
app.add_handler(CommandHandler("addsudo", addsudo))
app.add_handler(CommandHandler("delsudo", delsudo))
app.add_handler(CommandHandler("listsudo", listsudo))
app.add_handler(CommandHandler("targetslide", targetslide))
app.add_handler(CommandHandler("stopslide", stopslide))
app.add_handler(CommandHandler("slidespam", slidespam))
app.add_handler(CommandHandler("stopslidespam", stopslidespam))
app.add_handler(CommandHandler("swipe", swipe))
app.add_handler(CommandHandler("stopswipe", stopswipe))
app.add_handler(MessageHandler(filters.TEXT & ~filters.COMMAND, auto_replies))
return app
async def run_all_bots():
global apps, bots
for token in TOKENS:
if token.strip():
try:
app = build_app(token)
apps.append(app)
bots.append(app.bot)
except Exception as e:
print("Failed building app:", e)
for app in apps:
try:
await app.initialize()
await app.start()
await app.updater.start_polling()
except Exception as e:
print("Failed starting app:", e)
print("Bot is running (all bots started).")
await asyncio.Event().wait()
if __name__ == "__main__":
loop = asyncio.new_event_loop()
asyncio.set_event_loop(loop)
loop.run_until_complete(run_all_bots())