forked from RowLyn/LuciTaggerBot-1
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathTagger.py
288 lines (238 loc) · 11.7 KB
/
Tagger.py
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
import random, os, logging, asyncio
from telethon import Button
from telethon import TelegramClient, events
from telethon.sessions import StringSession
from telethon.tl.types import ChannelParticipantsAdmins
logging.basicConfig(
level=logging.INFO,
format='%(name)s - [%(levelname)s] - %(message)s'
)
LOGGER = logging.getLogger(__name__)
api_id = int(os.environ.get("APP_ID"))
api_hash = os.environ.get("API_HASH")
bot_token = os.environ.get("TOKEN")
client = TelegramClient('client', api_id, api_hash).start(bot_token=bot_token)
anlik_calisan = []
tekli_calisan = []
@client.on(events.NewMessage(pattern="^/start$"))
async def start(event):
await event.reply("**🌀LuciTaggerBot**\n ile Grubunuzdakı Nerdeyse Tüm Üyelere Etiket Ata bilirim \nKomutlar için =======> /help yazın**",
buttons=(
[Button.url('Beni Gruba Ekle ➕', 'https://t.me/lucitaggerbot?startgroup=a')],
[Button.url('Support🛠', 'https://t.me/LuciSup')],
[Button.url('Resmi Kanal📣', 'https://t.me/LuciBots')],
[Button.url('Developer👨🏻💻', 'https://t.me/LuciMarka')],
),
link_preview=False
)
@client.on(events.NewMessage(pattern="^/help$"))
async def help(event):
helptext = "**🌀 LuciTaggerBot Komutları**\n\n**/tag <sebeb> - 5-li Etiket Atar**\n\n**/etag <sebeb> - Emoji ile etiketler**\n\n**/tektag sebeb - Üyeleri Tek Tek Etiketler**\n\n**/admins sebeb - Yöneticileri Tek Tek Tag Eder**\n\n**/start - botu başlatır**"
await event.reply(helptext,
buttons=(
[Button.url('Beni Gruba Ekle➕', 'https://t.me/lucitaggerbot?startgroup=a')],
[Button.url('Support👨💻', 'https://t.me/LuciSup')],
[Button.url('Resmi Kanal🔖', 'https://t.me/LuciBots')],
[Button.url('Developer🧑🔧', 'https://t.me/LuciMarka')],
),
link_preview=False
)
@client.on(events.NewMessage(pattern="^/reklam$"))
async def help(event):
helptext = "**Çok özellikleri Etiket Botu Bulmaya Çalışan Grub Sahibleri @LuciTaggerBot Size Göre:\n\n📌 5-li etiket\n📌 Emoji etiket\n📌 Tekli Etiket\n📌 Yalnız Yöneticileri etiketleme\n📌\n\n Böyle Çok özellikli @LuciTaggerBot 'u grubunuza yönetici olarak ekleyip rahatlıkla üyelir , etiket ata bilirsiz **"
await event.reply(helptext,
buttons=(
[Button.url('Botu Gruba Ekle➕', 'https://t.me/lucitaggerbot?startgroup=a')],
),
link_preview=False
)
@client.on(events.NewMessage(pattern='^(?i)/cancel'))
async def cancel(event):
global anlik_calisan
anlik_calisan.remove(event.chat_id)
emoji = "🐵 🦁 🐯 🐱 🐶 🐺 🐻 🐨 🐼 🐹 🐭 🐰 🦊 🦝 🐮 🐷 🐽 🐗 🦓 🦄 🐴 🐸 🐲 🦎 🐉 🦖 🦕 🐢 🐊 🐍 🐁 🐀 🐇 🐈 🐩 🐕 🦮 🐕🦺 🐅 🐆 🐎 🐖 🐄 🐂 🐃 🐏 🐑 🐐 🦌 🦙 🦥 🦘 🐘 🦏 🦛 🦒 🐒 🦍 🦧 🐪 🐫 🐿️ 🦨 🦡 🦔 🦦 🦇 🐓 🐔 🐣 🐤 🐥 🐦 🦉 🦅 🦜 🕊️ 🦢 🦩 🦚 🦃 🦆 🐧🦈 🐬 🐋 🐳 🐟 🐠 🐡 🦐 🦞 🦀 🦑 🐙 🦪 🦂 🕷️ 🦋 🐞 🐝 🦟 🦗 🐜 🐌 🐚 🕸️ 🐛 🐾 😀 😃 😄 😁 😆 😅 😂 🤣 😭 😗 😙 😚 😘 🥰 😍 🤩 🥳 🤗 🙃 🙂 ☺️ 😊 😏 😌 😉 🤭 😶 😐 😑 😔 😋 😛 😝 😜 🤪 🤔 🤨 🧐 🙄 😒 😤 😠 🤬 ☹️ 🙁 😕 😟 🥺 😳 😬 🤐 🤫 😰 😨 😧 😦 😮 😯 😲 😱 🤯 😢 😥 😓 😞 😖 😣 😩 😫 🤤 🥱 😴 😪 🌛 🌜 🌚 🌝 🌞 🤢 🤮 🤧 🤒 🍓 🍒 🍎 🍉 🍑 🍊 🥭 🍍 🍌 🌶 🍇 🥝 🍐 🍏 🍈 🍋 🍄 🥕 🍠 🧅 🌽 🥦 🥒 🥬 🥑 🥯 🥖 🥐 🍞 🥜 🌰 🥔 🧄 🍆 🧇 🥞 🥚 🧀 🥓 🥩 🍗 🍖 🥙 🌯 🌮 🍕 🍟 🥨 🥪 🌭 🍔 🧆 🥘 🍝 🥫 🥣 🥗 🍲 🍛 🍜 🍢 🥟 🍱 🍚 🥡 🍤 🍣 🦞 🦪 🍘 🍡 🥠 🥮 🍧 🍧 🍨".split(" ")
@client.on(events.NewMessage(pattern="^/etag ?(.*)"))
async def mentionall(event):
global anlik_calisan
if event.is_private:
return await event.respond("**Bu komutu gruplar ve kanallar için geçerli❗**")
admins = []
async for admin in client.iter_participants(event.chat_id, filter=ChannelParticipantsAdmins):
admins.append(admin.id)
if not event.sender_id in admins:
return await event.respond("**Bu komutu sadace yoneticiler kullana bilir〽️**")
if event.pattern_match.group(1):
mode = "text_on_cmd"
msg = event.pattern_match.group(1)
elif event.reply_to_msg_id:
mode = "text_on_reply"
msg = event.reply_to_msg_id
if msg == None:
return await event.respond("**Geçmiş mesajlar için etiket ede bilmiom**")
elif event.pattern_match.group(1) and event.reply_to_msg_id:
return await event.respond("Etiket Yapmak için sebeb yok❗️")
else:
return await event.respond("**Etikete Başlamak için sebeb yazın...!**")
if mode == "text_on_cmd":
anlik_calisan.append(event.chat_id)
usrnum = 0
usrtxt = ""
async for usr in client.iter_participants(event.chat_id):
usrnum += 1
usrtxt += f"[{random.choice(emoji)}](tg://user?id={usr.id}) "
if event.chat_id not in anlik_calisan:
await event.respond("** Etiket işlemi başarıyla durduruldu❌**")
return
if usrnum == 5:
await client.send_message(event.chat_id, f"{usrtxt}\n\n{msg}")
await asyncio.sleep(2)
usrnum = 0
usrtxt = ""
if mode == "text_on_reply":
anlik_calisan.append(event.chat_id)
usrnum = 0
usrtxt = ""
async for usr in client.iter_participants(event.chat_id):
usrnum += 1
usrtxt += f"[{random.choice(emoji)}](tg://user?id={usr.id}) "
if event.chat_id not in anlik_calisan:
await event.respond("Işlem Başarıyla Durduruldu\n\n**Buda sizin reklamınız ola bilir @LuciBots**❌")
return
if usrnum == 5:
await client.send_message(event.chat_id, usrtxt, reply_to=msg)
await asyncio.sleep(2)
usrnum = 0
usrtxt = ""
@client.on(events.NewMessage(pattern='^(?i)/cancel'))
async def cancel(event):
global anlik_calisan
anlik_calisan.remove(event.chat_id)
@client.on(events.NewMessage(pattern="^/tag ?(.*)"))
async def mentionall(event):
global anlik_calisan
if event.is_private:
return await event.respond("Bu komutu gruplar ve kanallar için geçerli❗️**")
admins = []
async for admin in client.iter_participants(event.chat_id, filter=ChannelParticipantsAdmins):
admins.append(admin.id)
if not event.sender_id in admins:
return await event.respond("**Bu komutu sadace yoneticiler kullana bilir〽️**")
if event.pattern_match.group(1):
mode = "text_on_cmd"
msg = event.pattern_match.group(1)
elif event.reply_to_msg_id:
mode = "text_on_reply"
msg = event.reply_to_msg_id
if msg == None:
return await event.respond("Önceki Mesajlara Cevab Vermeyin")
elif event.pattern_match.group(1) and event.reply_to_msg_id:
return await event.respond("Başlatmak için sebeb yok❗️")
else:
return await event.respond("Işleme başlamak için sebeb yok")
if mode == "text_on_cmd":
anlik_calisan.append(event.chat_id)
usrnum = 0
usrtxt = ""
async for usr in client.iter_participants(event.chat_id):
usrnum += 1
usrtxt += f"👥 - [{usr.first_name}](tg://user?id={usr.id}) \n"
if event.chat_id not in anlik_calisan:
await event.respond("Işlem Başarıyla Durduruldu\n\n**Buda sizin reklamınız ola bilir @LuciBots**❌")
return
if usrnum == 5:
await client.send_message(event.chat_id, f"{usrtxt}\n\n{msg}")
await asyncio.sleep(2)
usrnum = 0
usrtxt = ""
if mode == "text_on_reply":
anlik_calisan.append(event.chat_id)
usrnum = 0
usrtxt = ""
async for usr in client.iter_participants(event.chat_id):
usrnum += 1
usrtxt += f"👥 - [{usr.first_name}](tg://user?id={usr.id}) \n"
if event.chat_id not in anlik_calisan:
await event.respond("işlem başarıyla durduruldu❌")
return
if usrnum == 5:
await client.send_message(event.chat_id, usrtxt, reply_to=msg)
await asyncio.sleep(2)
usrnum = 0
usrtxt = ""
@client.on(events.NewMessage(pattern='^(?i)/cancel'))
async def cancel(event):
global anlik_calisan
anlik_calisan.remove(event.chat_id)
@client.on(events.NewMessage(pattern="^/tektag ?(.*)"))
async def mentionall(event):
global tekli_calisan
if event.is_private:
return await event.respond("**Bu komutu gruplar ve kanallar için geçerli❗️**")
admins = []
async for admin in client.iter_participants(event.chat_id, filter=ChannelParticipantsAdmins):
admins.append(admin.id)
if not event.sender_id in admins:
return await event.respond("**Bu komutu sadace yoneticiler kullana bilir〽**")
if event.pattern_match.group(1):
mode = "text_on_cmd"
msg = event.pattern_match.group(1)
elif event.reply_to_msg_id:
mode = "text_on_reply"
msg = event.reply_to_msg_id
if msg == None:
return await event.respond("**önceki mesajı etiketleye bilmerim*")
elif event.pattern_match.group(1) and event.reply_to_msg_id:
return await event.respond("Başlamaq için Sebeb Yazın❗️")
else:
return await event.respond("**Işleme başlamağım için sebeb yazın..**")
if mode == "text_on_cmd":
tekli_calisan.append(event.chat_id)
usrnum = 0
usrtxt = ""
async for usr in client.iter_participants(event.chat_id):
usrnum += 1
usrtxt += f"**👤 - [{usr.first_name}](tg://user?id={usr.id}) \n**"
if event.chat_id not in tekli_calisan:
await event.respond("**Işlem Başarıyla Durduruldu\n\n**Buda sizin reklamınız ola bilir @LuciBots**❌****")
return
if usrnum == 1:
await client.send_message(event.chat_id, f"{usrtxt} {msg}")
await asyncio.sleep(2)
usrnum = 0
usrtxt = ""
if mode == "text_on_reply":
tekli_calisan.append(event.chat_id)
usrnum = 0
usrtxt = ""
async for usr in client.iter_participants(event.chat_id):
usrnum += 1
usrtxt += f"👤 - [{usr.first_name}](tg://user?id={usr.id}) \n"
if event.chat_id not in tekli_calisan:
await event.respond("Işlem Başarıyla Durduruldu\n\n**Buda sizin reklamınız ola bilir @LuciBots**❌**")
return
if usrnum == 1:
await client.send_message(event.chat_id, usrtxt, reply_to=msg)
await asyncio.sleep(2)
usrnum = 0
usrtxt = ""
@client.on(events.NewMessage(pattern='^(?i)/cancel'))
async def cancel(event):
global tekli_calisan
tekli_calisan.remove(event.chat_id)
@client.on(events.NewMessage(pattern="^/admins ?(.*)"))
async def mentionall(tagadmin):
if tagadmin.pattern_match.group(1):
seasons = tagadmin.pattern_match.group(1)
else:
seasons = ""
chat = await tagadmin.get_input_chat()
a_=0
await tagadmin.delete()
async for i in client.iter_participants(chat, filter=cp):
if a_ == 500:
break
a_+=5
await tagadmin.client.send_message(tagadmin.chat_id, "**[{}](tg://user?id={}) {}**".format(i.first_name, i.id, seasons))
sleep(0.5)
print(">> Bot çalıyor merak etme 🚀 @lucimarka bilgi alabilirsin <<")
client.run_until_disconnected()