├── Procfile ├── README.md ├── TeamAlexa.py ├── TeamAlexa └── markup_maker.py ├── app.json ├── configs.py ├── markup_maker.py └── requirements.txt /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 TeamAlexa.py -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

❤️ VERIFICATION BOT ❤️

2 | 3 |

": "A Telegram Bot for verifying new group members by Emojis Captcha. Made by [Rocks](t.me/Shayri_Music_Lovers)
... Written By Abir Hassan...

4 | 5 |

6 | 7 |

8 | Codacy 9 | 10 | 11 | 12 | 13 | 14 |

15 | 16 | > ⭐️ Thanks to everyone for using, That is the greatest pleasure we have ! 17 | 18 | ## Avaiilable on Telegram as [@AsadSupport](https://t.me/Dr_Asad_Ali) 19 | 20 | ## ✨ Easy To Deploy Direct In Repo✨ 21 | 22 | The Easiest Way To Deploy This Bot Direct From GitHub 23 | 24 |

25 | 26 | ## ✨ Easy To Deploy Direct In Repo✨ 27 | 28 | The Easiest Way To Deploy This On Heroku For Any Browser Copy Link Supported 29 | 30 |

31 | 32 | 33 | # ❤️ Support 34 | 35 | 36 | 37 | 38 | 39 | ## CREDITS 40 | 41 | - [Asad Ali](https://t.me/Dr_Asad_Ali) 42 | - [YouTube](https://www.youtube.com/c/JankariKiDuniya) 43 | - [Harshit Sharma](https://t.me/HarshitSharma361) 44 | - [Abir Hassan](https://github.com/AbirHasan2005) 45 | -------------------------------------------------------------------------------- /TeamAlexa.py: -------------------------------------------------------------------------------- 1 | # TeamAlexa Verification Bot Property Of TeamAlexa 2 | # Indian Largest Chatting Group 3 | # Without Credit (Mother Fucker) 4 | # TeamAlexa © @Dr_Asad_Ali © TeamAlexa 5 | # Owner Asad + Harshit 6 | 7 | import random 8 | import aiohttp 9 | import asyncio 10 | from configs import Config 11 | from pyrogram import Client, filters 12 | from pyrogram.errors import UserNotParticipant 13 | from TeamAlexa.markup_maker import MakeCaptchaMarkup 14 | from pyrogram.types import ( 15 | InlineKeyboardMarkup, 16 | InlineKeyboardButton, 17 | Message, 18 | CallbackQuery, 19 | ChatPermissions, 20 | ) 21 | 22 | CaptchaBot = Client( 23 | session_name=Config.SESSION_NAME, 24 | api_id=Config.API_ID, 25 | api_hash=Config.API_HASH, 26 | bot_token=Config.BOT_TOKEN, 27 | ) 28 | CaptchaDB = {} 29 | 30 | 31 | @CaptchaBot.on_message(filters.command("start")) 32 | async def start_handler(_, event: Message): 33 | await event.reply_text( 34 | "**ʜᴇʟʟᴏ sᴡᴇᴇᴛ ʜᴇᴀʀᴛ ɪ ᴀᴍ ʀᴏᴄᴋs ᴠᴇʀɪғɪᴄᴀᴛɪᴏɴ ʙᴏᴛ ᴛᴏ ᴠᴇʀɪғʏ ᴛʜᴇ ɴᴇᴡ ɢʀᴏᴜᴘ ᴍᴇᴍʙᴇʀs ɪɴ ᴛᴇʟᴇɢʀᴀᴍ**👻\n\n**ɢɪᴠᴇ ᴍᴇ ʜᴇᴀʀᴛ** [ʟᴏᴠᴇ](https://t.me/Give_Me_Heart) [ᴊᴏɪɴ](t.me/Shayri_Music_Lovers) **ᴛʜᴀɴᴋs ғᴏʀ ᴜsɪɴɢ**.", 35 | disable_web_page_preview=True, 36 | ) 37 | 38 | 39 | @CaptchaBot.on_chat_member_updated() 40 | async def welcome_handler(bot: Client, event: Message): 41 | if (event.chat.id != Config.GROUP_CHAT_ID) or (event.from_user.is_bot is True): 42 | return 43 | try: 44 | user_ = await bot.get_chat_member(event.chat.id, event.from_user.id) 45 | if (user_.is_member is False) and ( 46 | CaptchaDB.get(event.from_user.id, None) is not None 47 | ): 48 | try: 49 | await bot.delete_messages( 50 | chat_id=event.chat.id, 51 | message_ids=CaptchaDB[event.from_user.id]["message_id"], 52 | ) 53 | except: 54 | pass 55 | return 56 | elif (user_.is_member is False) and ( 57 | CaptchaDB.get(event.from_user.id, None) is None 58 | ): 59 | return 60 | except UserNotParticipant: 61 | return 62 | try: 63 | if CaptchaDB.get(event.from_user.id, None) is not None: 64 | try: 65 | await bot.send_message( 66 | chat_id=event.chat.id, 67 | text=f"{event.from_user.mention} 🙄 **ᴏʏᴇ ɴᴏᴏʙ ʙɪɴᴀ ᴠᴇʀɪғɪᴄᴀᴛɪᴏɴ ɢʀᴏᴜᴘ ᴊᴏɪɴ ᴋɪʏᴀ**!\n\n" 68 | f"😜 **ʜᴇ ᴄᴀɴ ᴛʀʏ ᴀɢᴀɪɴ ᴀғᴛᴇʀ 10ᴍ**.", 69 | disable_web_page_preview=True, 70 | ) 71 | await bot.restrict_chat_member( 72 | chat_id=event.chat.id, 73 | user_id=event.from_user.id, 74 | permissions=ChatPermissions(can_send_messages=False), 75 | ) 76 | await bot.delete_messages( 77 | chat_id=event.chat.id, 78 | message_ids=CaptchaDB[event.from_user.id]["message_id"], 79 | ) 80 | except: 81 | pass 82 | await asyncio.sleep(600) 83 | del CaptchaDB[event.from_user.id] 84 | else: 85 | await bot.restrict_chat_member( 86 | chat_id=event.chat.id, 87 | user_id=event.from_user.id, 88 | permissions=ChatPermissions(can_send_messages=False), 89 | ) 90 | await bot.send_message( 91 | chat_id=event.chat.id, 92 | text=f"{event.from_user.mention}, ❤️ **ʜᴏᴡ ᴀʀᴇ ʏᴏᴜ ᴛᴏ ᴄʜᴀᴛ ʜᴇʀᴇ ᴘʟᴇᴀsᴇ ᴠɪʀɪғʏ ᴛʜᴀᴛ ʏᴏᴜ ᴀʀᴇ ɴᴏᴛ ᴀ ʙᴏᴛ**", 93 | reply_markup=InlineKeyboardMarkup( 94 | [ 95 | [ 96 | InlineKeyboardButton( 97 | "ᴠᴇʀɪғʏ ɴᴏᴡ", 98 | callback_data=f"startVerify_{str(event.from_user.id)}", 99 | ) 100 | ] 101 | ] 102 | ), 103 | ) 104 | except: 105 | pass 106 | 107 | 108 | @CaptchaBot.on_callback_query() 109 | async def buttons_handlers(bot: Client, cb: CallbackQuery): 110 | if cb.data.startswith("startVerify_"): 111 | __user = cb.data.split("_", 1)[-1] 112 | if cb.from_user.id != int(__user): 113 | await cb.answer( 114 | "🙄 𝗧𝗵𝗶𝘀 𝗠𝗲𝘀𝘀𝗮𝗴𝗲 𝗜𝘀 𝗡𝗼𝘁 𝗙𝗼𝗿 𝗬𝗼𝘂 𝗜𝘁𝘁𝘂 🤏 𝗦𝗲𝘆 𝗡𝗼𝗼𝗯!", show_alert=True 115 | ) 116 | return 117 | await cb.message.edit("😏 **ɢᴇɴᴇʀᴀᴛɪɴɢ ᴄᴀᴘᴛᴄʜᴇ** ...") 118 | print("Fetching Captcha JSON Data ...") 119 | async with aiohttp.ClientSession() as session: 120 | async with session.get( 121 | f"https://api.abirhasan.wtf/captcha?token={Config.CAPTCHA_API_TOKEN}" 122 | ) as res: 123 | if res.status != 200: 124 | try: 125 | UserOnChat = await bot.get_chat_member( 126 | user_id=cb.from_user.id, chat_id=cb.message.chat.id 127 | ) 128 | if UserOnChat.restricted_by.id == (await bot.get_me()).id: 129 | await bot.unban_chat_member( 130 | chat_id=cb.message.chat.id, user_id=cb.from_user.id 131 | ) 132 | except: 133 | pass 134 | await cb.message.edit("😢 𝗨𝗻𝗮𝗯𝗹𝗲 𝗧𝗼 𝗚𝗲𝘁 𝗖𝗮𝗽𝘁𝗰𝗵𝗲!") 135 | return 136 | data = await res.json() 137 | print("Done!") 138 | markup = [[], [], []] 139 | __emojis = data["CaptchaAnswer"].split(": ", 1)[-1].split() 140 | print(__emojis) 141 | _emojis = [ 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 | print("Cleaning Answer Emojis from Emojis List ...") 225 | for a in range(len(__emojis)): 226 | if __emojis[a] in _emojis: 227 | _emojis.remove(__emojis[a]) 228 | show = __emojis 229 | print("Appending New Emoji List ...") 230 | for b in range(9): 231 | show.append(_emojis[b]) 232 | print("Randomizing ...") 233 | random.shuffle(show) 234 | count = 0 235 | print("Appending to ROW - 1") 236 | for _ in range(5): 237 | markup[0].append( 238 | InlineKeyboardButton( 239 | f"{show[count]}", 240 | callback_data=f"verify_{str(cb.from_user.id)}_{show[count]}", 241 | ) 242 | ) 243 | count += 1 244 | print("Appending to ROW - 2") 245 | for _ in range(5): 246 | markup[1].append( 247 | InlineKeyboardButton( 248 | f"{show[count]}", 249 | callback_data=f"verify_{str(cb.from_user.id)}_{show[count]}", 250 | ) 251 | ) 252 | count += 1 253 | print("Appending to ROW - 3") 254 | for _ in range(5): 255 | markup[2].append( 256 | InlineKeyboardButton( 257 | f"{show[count]}", 258 | callback_data=f"verify_{str(cb.from_user.id)}_{show[count]}", 259 | ) 260 | ) 261 | count += 1 262 | print("Setting Up in Database ...") 263 | CaptchaDB[cb.from_user.id] = { 264 | "emojis": data["CaptchaAnswer"].split(": ", 1)[-1].split(), 265 | "mistakes": 0, 266 | "group_id": cb.message.chat.id, 267 | "message_id": None, 268 | } 269 | print("Sending Captcha ...") 270 | __message = await bot.send_photo( 271 | chat_id=cb.message.chat.id, 272 | photo=data["DownloadURL"], 273 | caption=f"{cb.from_user.mention}, 😉 **sᴇʟᴇᴄᴛ ᴀʟʟ ᴛʜᴇ ᴇᴍᴏᴊɪᴇs ᴄᴀɴ sᴇᴇ ɪɴ ᴛʜɪs ᴘɪᴄᴛᴜʀᴇ**. " 274 | f"🤗 **ʏᴏᴜ ᴀʀᴇ ᴀʟʟᴏᴡᴇᴅ ᴏɴʟʏ** (3) **ᴍɪsᴛᴀᴄᴋᴇs**.", 275 | reply_markup=InlineKeyboardMarkup(markup), 276 | ) 277 | CaptchaDB[cb.from_user.id]["message_id"] = __message.message_id 278 | await cb.message.delete(revoke=True) 279 | 280 | elif cb.data.startswith("verify_"): 281 | __emoji = cb.data.rsplit("_", 1)[-1] 282 | __user = cb.data.split("_")[1] 283 | if cb.from_user.id != int(__user): 284 | await cb.answer("😜 𝗨𝗹𝗼 𝗬𝗲 𝗠𝗲𝘀𝘀𝗮𝗴𝗲 𝗧𝗲𝗿𝗲 𝗟𝗶𝘆𝗲 𝗡𝗶 𝗛𝗮𝗶!", show_alert=True) 285 | return 286 | if cb.from_user.id not in CaptchaDB: 287 | await cb.answer("😉 𝗧𝗿𝘆 𝗔𝗴𝗮𝗶𝗻 𝗔𝗳𝘁𝗲𝗿 𝗥𝗲_𝗝𝗼𝗶𝗻𝗶𝗻𝗴!", show_alert=True) 288 | if __emoji not in CaptchaDB.get(cb.from_user.id).get("emojis"): 289 | CaptchaDB[cb.from_user.id]["mistakes"] += 1 290 | await cb.answer("🙄 𝗬𝗼𝘂 𝗣𝗿𝗲𝘀𝘀𝗲𝗱 𝗔 𝗪𝗿𝗼𝗻𝗴 𝗘𝗺𝗼𝗷𝗶!", show_alert=True) 291 | n = 3 - CaptchaDB[cb.from_user.id]["mistakes"] 292 | if n == 0: 293 | await cb.message.edit_caption( 294 | f"{cb.from_user.mention}, **😢 **ʏᴏᴜ ғᴀɪʟᴇᴅ ᴛᴏ ᴘᴀss ᴛʜᴇ ᴄᴀᴘᴛᴄʜᴇ**!\n\n" 295 | f"❤️ **ʏᴏᴜ ᴄᴀɴ ᴛʀʏ ᴀɢᴀɪɴ ᴀғᴛᴇʀ 10ᴍ ᴏʀ ᴄᴏɴᴛᴀᴄᴛ** @Dr_Asad_Ali.", 296 | reply_markup=None, 297 | ) 298 | await asyncio.sleep(600) 299 | del CaptchaDB[cb.from_user.id] 300 | return 301 | markup = await MakeCaptchaMarkup( 302 | cb.message["reply_markup"]["inline_keyboard"], __emoji, "❌" 303 | ) 304 | await cb.message.edit_caption( 305 | caption=f"{cb.from_user.mention}, select all the emojis you can see in the picture. " 306 | f"😜 **ʏᴏᴜ ᴀʀᴇ ᴀʟʟᴏᴡᴇᴅ ᴏɴʟʏ** ({n}) **ᴍɪsᴛᴀᴄᴋᴇs**.", 307 | reply_markup=InlineKeyboardMarkup(markup), 308 | ) 309 | return 310 | else: 311 | CaptchaDB.get(cb.from_user.id).get("emojis").remove(__emoji) 312 | markup = await MakeCaptchaMarkup( 313 | cb.message["reply_markup"]["inline_keyboard"], __emoji, "✅" 314 | ) 315 | await cb.message.edit_reply_markup( 316 | reply_markup=InlineKeyboardMarkup(markup) 317 | ) 318 | if not CaptchaDB.get(cb.from_user.id).get("emojis"): 319 | await cb.answer("❤️ 𝗬𝗼𝘂 𝗣𝗮𝘀𝘀𝗲𝗱 𝗧𝗵𝗲 𝗖𝗮𝗽𝘁𝗰𝗵𝗲", show_alert=True) 320 | del CaptchaDB[cb.from_user.id] 321 | try: 322 | UserOnChat = await bot.get_chat_member( 323 | user_id=cb.from_user.id, chat_id=cb.message.chat.id 324 | ) 325 | if UserOnChat.restricted_by.id == (await bot.get_me()).id: 326 | await bot.unban_chat_member( 327 | chat_id=cb.message.chat.id, user_id=cb.from_user.id 328 | ) 329 | except: 330 | pass 331 | await cb.message.delete(True) 332 | await cb.answer() 333 | 334 | 335 | CaptchaBot.run() 336 | -------------------------------------------------------------------------------- /TeamAlexa/markup_maker.py: -------------------------------------------------------------------------------- 1 | # Rocks Verification Bot Property Of Rocks 2 | # Indian Largest Chatting Group 3 | # Without Credit (Mother Fucker) 4 | # Rocks © @Dr_Asad_Ali © Rocks 5 | # Owner Asad + Harshit 6 | 7 | 8 | async def MakeCaptchaMarkup(markup, __emoji, indicator): 9 | __markup = markup 10 | for i in markup: 11 | for k in i: 12 | if k["text"] == __emoji: 13 | k["text"] = f"{indicator}" 14 | k["callback_data"] = "HeHe" 15 | return __markup 16 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Rocks Verification.", 3 | "description": "A Telegram Bot for verifying new group members by Emojis Captcha. Made by @Rocks.", 4 | "logo": "https://telegra.ph/file/a315c0e3ae8e497400ab0.jpg", 5 | "keywords": [ 6 | "telegram", 7 | "emoji", 8 | "captcha", 9 | "bot" 10 | ], 11 | "repository": "https://github.com/jankarikiduniya/Rocks-VerificationBot", 12 | "website": "https://t.me/Dr_Asad_Ali", 13 | "success_url": "https://t.me/AsadSupport", 14 | "env": { 15 | "API_ID": { 16 | "description": "Get this value from my.telegram.org or @TeleORG_Bot" 17 | }, 18 | "API_HASH": { 19 | "description": "Get this value from my.telegram.org or @TeleORG_Bot" 20 | }, 21 | "BOT_TOKEN": { 22 | "description": "Get this from @BotFather" 23 | }, 24 | "MONGODB_URI": { 25 | "description": "MongoDB URI for Saving Chat Settings. Video Tutorial Here: https://www.youtube.com/watch?v=aXlF80Cn7iU" 26 | }, 27 | "OWNER_ID": { 28 | "description": "Your Telegram User ID for using Admin commands.", 29 | "required": false 30 | }, 31 | "SESSION_NAME": { 32 | "description": "A Bot Session Name without Space.", 33 | "required": false 34 | }, 35 | "GROUP_CHAT_ID": { 36 | "description": "Your Telegram Group ID where the bot will ask for verify by Captcha." 37 | }, 38 | "CAPTCHA_API_TOKEN": { 39 | "description": "Needs Captcha API Token to get Captcha. Get this from https://t.me/Dr_Asad_Ali !!" 40 | } 41 | }, 42 | "buildpacks": [ 43 | { 44 | "url": "heroku/python" 45 | } 46 | ], 47 | "formation": { 48 | "worker": { 49 | "quantity": 1, 50 | "size": "free" 51 | } 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /configs.py: -------------------------------------------------------------------------------- 1 | # Rocks Verification Bot Property Of Rocks 2 | # Indian Largest Chatting Group 3 | # Without Credit (Mother Fucker) 4 | # Rocks © @Dr_Asad_Ali © Rocks 5 | # Owner Asad + Harshit 6 | 7 | import os 8 | 9 | 10 | class Config(object): 11 | API_ID = int(os.environ.get("API_ID", 12345)) 12 | API_HASH = os.environ.get("API_HASH", "") 13 | BOT_TOKEN = os.environ.get("BOT_TOKEN", "") 14 | SESSION_NAME = os.environ.get("SESSION_NAME", "Captcha-Bot") 15 | GROUP_CHAT_ID = int(os.environ.get("GROUP_CHAT_ID", -100)) 16 | CAPTCHA_API_TOKEN = os.environ.get("CAPTCHA_API_TOKEN", "") 17 | -------------------------------------------------------------------------------- /markup_maker.py: -------------------------------------------------------------------------------- 1 | # Rocks Verification Bot Property Of Rocks 2 | # Indian Largest Chatting Group 3 | # Without Credit (Mother Fucker) 4 | # Rocks © @Dr_Asad_Ali © Rocks 5 | # Owner Asad + Harshit 6 | 7 | 8 | async def MakeCaptchaMarkup(markup, __emoji, indicator): 9 | __markup = markup 10 | for i in markup: 11 | for k in i: 12 | if k["text"] == __emoji: 13 | k["text"] = f"{indicator}" 14 | k["callback_data"] = "HeHe" 15 | return __markup 16 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | Pyrogram 2 | TgCrypto 3 | aiohttp 4 | --------------------------------------------------------------------------------