-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathBikash.py
More file actions
355 lines (317 loc) · 15.9 KB
/
Bikash.py
File metadata and controls
355 lines (317 loc) · 15.9 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
from pyrogram import Client, filters
from pyrogram.types import *
from pymongo import MongoClient
import requests
import random
import os
import re
API_ID = os.environ.get("API_ID", "none")
API_HASH = os.environ.get("API_HASH", "none")
BOT_TOKEN = os.environ.get("BOT_TOKEN", "none")
MONGO_URL = os.environ.get("MONGO_URL", "none")
BOT_IMAGE = os.environ.get("BOT_IMAGE", "none")
BOT_USERNAME = os.environ.get("BOT_USERNAME", "none")
OWNER_USERNAME = os.environ.get("OWNER_USERNAME", "none")
SUPPORT_GROUP = os.environ.get("SUPPORT_GROUP", "none")
UPDATES_CHANNEL = os.environ.get("UPDATES_CHANNEL", "none")
bot = Client(
"V_Chat_Bot" ,
api_id = API_ID,
api_hash = API_HASH ,
bot_token = BOT_TOKEN
)
async def is_admins(chat_id: int):
return [
member.user.id
async for member in bot.iter_chat_members(
chat_id, filter="administrators"
)
]
@bot.on_message(filters.command("start") & filters.private & ~filters.edited)
async def start_(client: Client, message: Message):
await message.reply_photo(
photo=f"{BOT_IMAGE}",
caption=f"""**━━━━━━━━━━━━━━━━━━━━━━━━
💥 𝐇𝐢 𝐈'𝐦 𝐀 𝐀𝐝𝐯𝐚𝐧𝐜𝐞 𝐂𝐡𝐚𝐭 𝐁𝐨𝐭 🌷.\n\n📌 𝐌𝐲 𝐍𝐚𝐦𝐞 𝐈𝐬 ⏤͟͟͞🌙⃟⏤͟͟͞͞ 🇲𝚂.❥︎🇭𝚘𝚗𝚎𝚢 🫧⃟🪸࿐ 𝐂𝐡𝐚𝐭 𝐁𝐨𝐭 🌷 𝐅𝐨𝐫𝐦 𝐈𝐧𝐝𝐢𝐚 🇮🇳 \n\n🌷 𝐈'𝐦 𝐀 𝐀𝐫𝐭𝐢𝐟𝐢𝐜𝐢𝐚𝐥 𝐈𝐧𝐭𝐞𝐥𝐥𝐢𝐠𝐞𝐧𝐜𝐞 🌷\n\n /chatbot - [on|off] 𝐓𝐡𝐢𝐬 𝐂𝐨𝐦𝐦𝐚𝐧𝐝 𝐔𝐬𝐞 𝐎𝐧𝐥𝐲 𝐀𝐧𝐲 𝐆𝐫𝐨𝐮𝐩
┏━━━━━━━━━━━━━━━━━┓
┣❥︎ ♕︎𝐎𝐰𝐧𝐞𝐫♕︎ » [𝐂𝐥𝐢𝐜𝐤 𝐇𝐞𝐫𝐞](https://t.me/{OWNER_USERNAME})
┣❥︎ 𝐔𝐩𝐝𝐚𝐭𝐞𝐬 ➪ » [𝐂𝐥𝐢𝐜𝐤 𝐇𝐞𝐫𝐞](https://t.me/{UPDATES_CHANNEL})
┣❥︎ 𝐒𝐮𝐩𝐩𝐨𝐫𝐭 ➪ » [𝐂𝐥𝐢𝐜𝐤 𝐇𝐞𝐫𝐞](https://t.me/{SUPPORT_GROUP})
┣❥︎ 𝐂𝐫𝐞𝐚𝐭𝐨𝐫𝐬 ➪ » [𝐂𝐥𝐢𝐜𝐤 𝐇𝐞𝐫𝐞](https://t.me/HoneyChatBotCreators)
┗━━━━━━━━━━━━━━━━━┛
💞 𝐉𝐮𝐬𝐭 𝐀𝐝𝐝 𝐌𝐞 » 𝐓𝐨 𝐘𝐨𝐮𝐫 𝐆𝐫𝐨𝐮𝐩 𝐀𝐧𝐝
𝐄𝐧𝐣𝐨𝐲 𝐒𝐮𝐩𝐞𝐫 𝐐𝐮𝐚𝐥𝐢𝐭𝐲 ❥︎𝐂𝐡𝐚𝐭.
━━━━━━━━━━━━━━━━━━━━━━━━**""",
reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton(
"➕ ❰ 𝐀𝐝𝐝 𝐌𝐞 𝐓𝐨 𝐘𝐨𝐮𝐫 𝐆𝐫𝐨𝐮𝐩 ❱ ➕", url=f"https://t.me/{BOT_USERNAME}?startgroup=true")
]
]
),
)
@bot.on_message(filters.command(["/start", f"start@{BOT_USERNAME}", "/alive", ".alive", "#bikash", "#aditya"]) & filters.group & ~filters.edited)
async def start(client: Client, message: Message):
await message.reply_photo(
photo=f"{BOT_IMAGE}",
caption=f"""💥 𝐇𝐢! 𝐈'𝐦 𝐀 𝐀𝐝𝐯𝐚𝐧𝐜𝐞 𝐂𝐡𝐚𝐭 𝐁𝐨𝐭 🌷.\n\n📌 𝐌𝐲 𝐍𝐚𝐦𝐞 𝐈𝐬 ⏤͟͟͞🌙⃟⏤͟͟͞͞ 🇲𝚂.❥︎🇭𝚘𝚗𝚎𝚢 🫧⃟🪸࿐ 𝐁𝐨𝐭 🌷 𝐅𝐨𝐫𝐦 𝐈𝐧𝐝𝐢𝐚 🇮🇳 \n\n🌷 𝐈'𝐦 𝐀 𝐀𝐫𝐭𝐢𝐟𝐢𝐜𝐢𝐚𝐥 𝐈𝐧𝐭𝐞𝐥𝐥𝐢𝐠𝐞𝐧𝐜𝐞 🌷\n\n𝐀𝐧𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐓𝐨 [𝐑𝐞𝐩𝐨𝐫𝐭](https://t.me/{SUPPORT_GROUP}) 🥀\n\n[𝐔𝐩𝐝𝐚𝐭𝐞𝐬](https://t.me/{UPDATES_CHANNEL}) 🌷\n\n /chatbot - [on|off]""",
reply_markup=InlineKeyboardMarkup(
[
[
InlineKeyboardButton(
" 💥 𝐉𝐨𝐢𝐧 𝐎𝐮𝐫 𝐍𝐞𝐭𝐰𝐨𝐫𝐤 𝐂𝐡𝐚𝐧𝐧𝐞𝐥 💞", url=f"https://t.me/Our_Updates_channel")
]
]
),
)
@bot.on_message(
filters.command("chatbot off", prefixes=["/", ".", "?", "-"])
& ~filters.private)
async def chatbotofd(client, message):
vdb = MongoClient(MONGO_URL)
v = vdb["vDb"]["v"]
if message.from_user:
user = message.from_user.id
chat_id = message.chat.id
if user not in (
await is_admins(chat_id)
):
return await message.reply_text(
"💥 𝐇𝐞𝐲 𝐘𝐨𝐮 𝐀𝐫𝐞 𝐍𝐨𝐭 𝐀 𝐀𝐝𝐦𝐢𝐧 💥"
)
is_v = v.find_one({"chat_id": message.chat.id})
if not is_v:
v.insert_one({"chat_id": message.chat.id})
await message.reply_text(f"🌷 ⏤͟͟͞🌙⃟⏤͟͟͞͞ 🇲𝚂.❥︎🇭𝚘𝚗𝚎𝚢 🫧⃟🪸࿐ 𝐂𝐡𝐚𝐭𝐛𝐨𝐭 𝐃𝐢𝐬𝐚𝐛𝐥𝐞𝐝 🥀!\n\n𝐀𝐧𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐓𝐨 [𝐑𝐞𝐩𝐨𝐫𝐭](https://t.me/{SUPPORT_GROUP}) 🥀\n\n[𝐔𝐩𝐝𝐚𝐭𝐞𝐬](https://t.me/{UPDATES_CHANNEL}) 🌷")
if is_v:
await message.reply_text(f"🌷 ⏤͟͟͞🌙⃟⏤͟͟͞͞ 🇲𝚂.❥︎🇭𝚘𝚗𝚎𝚢 🫧⃟🪸࿐ 𝐂𝐡𝐚𝐭𝐛𝐨𝐭 𝐈𝐬 𝐀𝐥𝐫𝐞𝐚𝐝𝐭 𝐃𝐢𝐬𝐚𝐛𝐥𝐞𝐝 🥀!\n\n𝐀𝐧𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐓𝐨 [𝐑𝐞𝐩𝐨𝐫𝐭](https://t.me/{SUPPORT_GROUP}) 🥀\n\n[𝐔𝐩𝐝𝐚𝐭𝐞𝐬](https://t.me/{UPDATES_CHANNEL}) 🌷")
@bot.on_message(
filters.command("chatbot on", prefixes=["/", ".", "?", "-"])
& ~filters.private)
async def chatboton(client, message):
vdb = MongoClient(MONGO_URL)
v = vdb["vDb"]["v"]
if message.from_user:
user = message.from_user.id
chat_id = message.chat.id
if user not in (
await is_admins(chat_id)
):
return await message.reply_text(
"You are not admin"
)
is_v = v.find_one({"chat_id": message.chat.id})
if not is_v:
await message.reply_text(f"💥 ⏤͟͟͞🌙⃟⏤͟͟͞͞ 🇲𝚂.❥︎🇭𝚘𝚗𝚎𝚢 🫧⃟🪸࿐ 𝐂𝐡𝐚𝐭𝐛𝐨𝐭 𝐈𝐬 𝐀𝐥𝐫𝐞𝐚𝐝𝐲𝐄𝐧𝐚𝐛𝐥𝐞𝐝🌷!\n\n𝐀𝐧𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐓𝐨 [𝐑𝐞𝐩𝐨𝐫𝐭](https://t.me/{SUPPORT_GROUP}) 🥀\n\n[𝐔𝐩𝐝𝐚𝐭𝐞𝐬](https://t.me/{UPDATES_CHANNEL}) 🌷")
if is_v:
v.delete_one({"chat_id": message.chat.id})
await message.reply_text(f"💥 ⏤͟͟͞🌙⃟⏤͟͟͞͞ 🇲𝚂.❥︎🇭𝚘𝚗𝚎𝚢 🫧⃟🪸࿐ 𝐂𝐡𝐚𝐭𝐛𝐨𝐭 𝐈𝐬 𝐄𝐧𝐚𝐛𝐥𝐞𝐝 🌷!\n\n𝐀𝐧𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐓𝐨 [𝐑𝐞𝐩𝐨𝐫𝐭](https://t.me/{SUPPORT_GROUP}) 🥀\n\n[𝐔𝐩𝐝𝐚𝐭𝐞𝐬](https://t.me/{UPDATES_CHANNEL}) 🌷")
@bot.on_message(
filters.command("chatbot", prefixes=["/", ".", "?", "-"])
& ~filters.private)
async def chatbot(client, message):
await message.reply_text(f"**🇮🇳 𝐔𝐬𝐚𝐠𝐞 🌷 :**\n/chatbot [on|off] 𝐎𝐧𝐥𝐲 𝐆𝐫𝐨𝐮𝐩 🇮🇳 !\n\n𝐀𝐧𝐲 𝐏𝐫𝐨𝐛𝐥𝐞𝐦 𝐓𝐨 [𝐑𝐞𝐩𝐨𝐫𝐭](https://t.me/{SUPPORT_GROUP}) 🥀\n\n[𝐔𝐩𝐝𝐚𝐭𝐞𝐬](https://t.me/{UPDATES_CHANNEL}) 🌷")
@bot.on_message(
(
filters.text
| filters.sticker
)
& ~filters.private
& ~filters.bot,
)
async def vai(client: Client, message: Message):
chatdb = MongoClient(MONGO_URL)
chatai = chatdb["Word"]["WordDb"]
if not message.reply_to_message:
vdb = MongoClient(MONGO_URL)
v = vdb["vDb"]["v"]
is_v = v.find_one({"chat_id": message.chat.id})
if not is_v:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.text})
k = chatai.find_one({"word": message.text})
if k:
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "sticker":
await message.reply_sticker(f"{hey}")
if not Yo == "sticker":
await message.reply_text(f"{hey}")
if message.reply_to_message:
vdb = MongoClient(MONGO_URL)
v = vdb["vDb"]["v"]
is_v = v.find_one({"chat_id": message.chat.id})
getme = await bot.get_me()
bot_id = getme.id
if message.reply_to_message.from_user.id == bot_id:
if not is_v:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.text})
k = chatai.find_one({"word": message.text})
if k:
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "sticker":
await message.reply_sticker(f"{hey}")
if not Yo == "sticker":
await message.reply_text(f"{hey}")
if not message.reply_to_message.from_user.id == bot_id:
if message.sticker:
is_chat = chatai.find_one({"word": message.reply_to_message.text, "id": message.sticker.file_unique_id})
if not is_chat:
chatai.insert_one({"word": message.reply_to_message.text, "text": message.sticker.file_id, "check": "sticker", "id": message.sticker.file_unique_id})
if message.text:
is_chat = chatai.find_one({"word": message.reply_to_message.text, "text": message.text})
if not is_chat:
chatai.insert_one({"word": message.reply_to_message.text, "text": message.text, "check": "none"})
@bot.on_message(
(
filters.sticker
| filters.text
)
& ~filters.private
& ~filters.bot,
)
async def vstickerai(client: Client, message: Message):
chatdb = MongoClient(MONGO_URL)
chatai = chatdb["Word"]["WordDb"]
if not message.reply_to_message:
vdb = MongoClient(MONGO_URL)
v = vdb["vDb"]["v"]
is_v = v.find_one({"chat_id": message.chat.id})
if not is_v:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.sticker.file_unique_id})
k = chatai.find_one({"word": message.text})
if k:
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "text":
await message.reply_text(f"{hey}")
if not Yo == "text":
await message.reply_sticker(f"{hey}")
if message.reply_to_message:
vdb = MongoClient(MONGO_URL)
v = vdb["vDb"]["v"]
is_v = v.find_one({"chat_id": message.chat.id})
getme = await bot.get_me()
bot_id = getme.id
if message.reply_to_message.from_user.id == bot_id:
if not is_v:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.text})
k = chatai.find_one({"word": message.text})
if k:
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "text":
await message.reply_text(f"{hey}")
if not Yo == "text":
await message.reply_sticker(f"{hey}")
if not message.reply_to_message.from_user.id == bot_id:
if message.text:
is_chat = chatai.find_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.text})
if not is_chat:
toggle.insert_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.text, "check": "text"})
if message.sticker:
is_chat = chatai.find_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.sticker.file_id})
if not is_chat:
chatai.insert_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.sticker.file_id, "check": "none"})
@bot.on_message(
(
filters.text
| filters.sticker
)
& filters.private
& ~filters.bot,
)
async def vprivate(client: Client, message: Message):
chatdb = MongoClient(MONGO_URL)
chatai = chatdb["Word"]["WordDb"]
if not message.reply_to_message:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.text})
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "sticker":
await message.reply_sticker(f"{hey}")
if not Yo == "sticker":
await message.reply_text(f"{hey}")
if message.reply_to_message:
getme = await bot.get_me()
bot_id = getme.id
if message.reply_to_message.from_user.id == bot_id:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.text})
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "sticker":
await message.reply_sticker(f"{hey}")
if not Yo == "sticker":
await message.reply_text(f"{hey}")
@bot.on_message(
(
filters.sticker
| filters.text
)
& filters.private
& ~filters.bot,
)
async def vprivatesticker(client: Client, message: Message):
chatdb = MongoClient(MONGO_URL)
chatai = chatdb["Word"]["WordDb"]
if not message.reply_to_message:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.sticker.file_unique_id})
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "text":
await message.reply_text(f"{hey}")
if not Yo == "text":
await message.reply_sticker(f"{hey}")
if message.reply_to_message:
getme = await bot.get_me()
bot_id = getme.id
if message.reply_to_message.from_user.id == bot_id:
await bot.send_chat_action(message.chat.id, "typing")
K = []
is_chat = chatai.find({"word": message.sticker.file_unique_id})
for x in is_chat:
K.append(x['text'])
hey = random.choice(K)
is_text = chatai.find_one({"text": hey})
Yo = is_text['check']
if Yo == "text":
await message.reply_text(f"{hey}")
if not Yo == "text":
await message.reply_sticker(f"{hey}")
bot.run()