├── Procfile ├── sample.env ├── requirements.txt ├── Dockerfile ├── app.json ├── README.md └── AlexaAi.py /Procfile: -------------------------------------------------------------------------------- 1 | worker: python3 AlexaAi.py 2 | -------------------------------------------------------------------------------- /sample.env: -------------------------------------------------------------------------------- 1 | API_ID= 2 | API_HASH= 3 | SESSION_NAME= 4 | MONGO_URL= 5 | -------------------------------------------------------------------------------- /requirements.txt: -------------------------------------------------------------------------------- 1 | flask==2.1.1 2 | werkzeug==2.0.3 3 | aiohttp 4 | pyrogram==1.4.16 5 | pymongo 6 | requests 7 | dnspython 8 | tgcrypto==1.2.2 9 | python-dotenv 10 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM python:3.10.4 2 | RUN apt update && apt upgrade -y 3 | RUN apt install python3-pip -y 4 | RUN apt install ffmpeg -y 5 | RUN curl -sL https://deb.nodesource.com/setup_16.x | bash - 6 | RUN apt-get install -y nodejs 7 | RUN npm i -g npm 8 | RUN mkdir /app/ 9 | COPY . /app 10 | WORKDIR /app 11 | RUN pip3 install --upgrade pip 12 | RUN pip3 install -U -r requirements.txt 13 | CMD python3 -m AlexaAi 14 | -------------------------------------------------------------------------------- /app.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "Alexa AI Userbot", 3 | "description": "Advanced Database Backend Chatbot Based On Pyrogram Userbot", 4 | "logo": "https://telegra.ph/file/71fdfc3bca2950bf3878c.jpg", 5 | "keywords": [ 6 | "telegram", 7 | "bot", 8 | "python", 9 | "pyrogram" 10 | ], 11 | "env": { 12 | "SESSION_NAME": { 13 | "description": "Pyrogram string session get it from @Session_Generator_Robot", 14 | "required": true 15 | }, 16 | "MONGO_URL": { 17 | "description": "mongo db url here", 18 | "required": true 19 | }, 20 | "API_ID": { 21 | "description": "telegram api id here", 22 | "required": true 23 | }, 24 | "API_HASH": { 25 | "description": "telegram api hash here", 26 | "required": true 27 | } 28 | }, 29 | "addons": [ 30 | { 31 | "plan": "heroku-postgresql" 32 | } 33 | ] 34 | } 35 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

❤️ ALEXA AI MACHINE BOT ❤️

2 | 3 |

A Telegram Userbot For AI Machine System To Increase Your Chat Ranking
... Written With Python, Pyrogram And Mongodb Backend Database...

4 | 5 |

6 | 7 |

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

15 | 16 | > ⭐️ Thanks to everyone for using Alexa, That is the greatest pleasure we have ! 17 | 18 | ### Asad– History 19 | 20 | 21 | 22 | ## Requirment. 23 | - Api ID 24 | - Api Hash 25 | - Pyrogram String Session 26 |

ɢᴇɴᴇʀᴀᴛᴇ sᴇssɪᴏɴ ᴠɪᴀ ᴛᴇʟᴇɢʀᴀᴍ sᴛʀɪɴɢ-ɢᴇɴ ʙᴏᴛ:

27 |

28 | 29 | ## ✨ ʜᴏsᴛ ᴀɪ ᴏɴ ʜᴇʀᴏᴋᴜ✨ 30 | 31 |

32 | 33 | ## ✨ ʜᴏsᴛ ᴀɪ ᴏɴ sᴄᴀʟɪɴɢᴏ ғᴏʀ 30 ᴅᴀʏs ғʀᴇᴇ ᴡɪᴛʜ ᴜɴʟɪɴɪᴛᴛᴇᴅ ᴅʏɴᴏs✨ 34 | 35 |

36 | 37 | 38 | ## Features ❤️® 39 | - ᴄʜᴀᴛʙᴏᴛ ʙᴀsᴇᴅ ᴏɴ ᴀɪ 40 | - ʙᴀᴄᴋᴇɴᴅ ᴅᴀᴛᴀʙᴀsᴇ sʏsᴛᴇᴍ 41 | - ɴᴏ ʙᴏᴛ ᴛᴏᴋᴇɴ ʀᴇǫᴜɪʀᴇᴅ 42 | 43 | # Owner And Credit 44 | 45 | 46 |
47 | ᴄʀᴇᴅɪᴛ 48 |
49 | 50 | ## sᴘᴇᴄɪᴀʟ ᴄʀᴇᴅɪᴛ 51 | 52 | - [ᴀsᴀᴅ ᴀʟɪ](https://t.me/Dr_Asad_Ali) ғᴏʀ ᴄᴏɴᴠᴇʀᴛɪɴɢ ɪɴᴛᴏ ᴜsᴇʀʙᴏᴛ. 53 | - [MetaVoid (Moezilla) ғᴏʀ ᴍᴀɪɴ ᴘʀᴏᴊᴇᴄᴛ](https://github.com/Moezilla) 54 | 55 |
56 | 57 |
58 | ʙʀᴏᴛʜᴇʀ 59 |
60 | 61 | - [ᴍᴜᴋᴜ](https://t.me/LEGEND_MUKUND) 62 | - [ᴅᴇᴠɪʟ](https://t.me/its_devil_911) 63 | - [ʜᴀʀsʜɪᴛ](https://t.me/HarshitSharma361) 64 | - [Abhimanyu](https://t.me/Itz_Venom_xD) 65 | 66 |
67 | 68 |
69 | sᴜᴘᴘᴏʀᴛ 70 |
71 | 72 | # ❤️ Support 73 | 74 | 75 | 76 | 77 | 78 |
79 | -------------------------------------------------------------------------------- /AlexaAi.py: -------------------------------------------------------------------------------- 1 | # © - MetaVoid (Moezilla) And Alexa Team For Modification 2 | # Give Credit ❣️Day 3 | 4 | from pyrogram import Client, filters 5 | import asyncio 6 | from pyrogram.types import * 7 | from pymongo import MongoClient 8 | import requests 9 | import random 10 | from pyrogram.errors import ( 11 | PeerIdInvalid, 12 | ChatWriteForbidden 13 | ) 14 | from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton, Message 15 | from pyrogram.errors import ChatAdminRequired, UserNotParticipant, ChatWriteForbidden 16 | from os import getenv 17 | import re 18 | from dotenv import load_dotenv 19 | 20 | load_dotenv() 21 | 22 | API_ID = int(getenv("API_ID", "")) 23 | API_HASH = getenv("API_HASH") 24 | SESSION_NAME = getenv("SESSION_NAME", None) 25 | MONGO_URL = getenv("MONGO_URL", None) 26 | 27 | client = Client(SESSION_NAME, API_ID, API_HASH) 28 | 29 | async def is_admins(chat_id: int): 30 | return [ 31 | member.user.id 32 | async for member in client.iter_chat_members( 33 | chat_id, filter="administrators" 34 | ) 35 | ] 36 | 37 | @client.on_message( 38 | filters.command("repo", prefixes=["/", ".", "?", "-"]) 39 | & ~filters.private) 40 | async def chatbot(client, message): 41 | await message.delete() 42 | alexaai = await message.reply("🤭🤏✌️") 43 | await asyncio.sleep(1) 44 | await alexaai.edit("**ʙᴏʜᴀᴛ ᴛᴀɪᴊ ʜᴏ ʀᴇᴘᴏ ᴄʜᴀʜɪʏᴇ**") 45 | await asyncio.sleep(1) 46 | await alexaai.edit("**ɪ ᴀᴍ ᴅᴏɪɴɢ ᴍʏ ʟᴏᴠᴇ 💕**") 47 | await alexaai.delete() 48 | await asyncio.sleep(2) 49 | umm = await message.reply_sticker("CAACAgIAAxkBAAEForNjAykaq_efq4Wd-9KZv-nNxJRn3AACIgMAAm2wQgO8x8PfoXC1eCkE") 50 | await asyncio.sleep(2) 51 | await message.reply_photo( 52 | photo=f"https://telegra.ph/file/2fabd1c33e888e0533891.jpg", 53 | caption=f"""━━━━━━━━━━━━━━━━━━━━━━━━ 54 | 💥 A ᴘᴏᴡᴇʀғᴜʟ ᴀɪ ʙᴏᴛ 55 | ᴏғ ♻️ ᴅʀ ᴀsᴀᴅ ᴀʟɪ 🔥 56 | ━━━━━━━━━━━━━━━━━ 57 | ᴅᴀᴛᴀʙᴀsᴇ ʙᴀᴄᴋᴇɴᴅ ʙᴏᴛ ғᴏʀ ᴛɢ... 58 | ┏━━━━━━━━━━━━━━━━━┓ 59 | ┣★ ᴄʀᴇᴀᴛᴇʀ [ᴀsᴀᴅ ᴀʟɪ](https://t.me/Dr_Asad_Ali) 60 | ┣★ ʜᴇᴀʀᴛ ᴜs [ʜᴇᴀʀᴛ ❤️](https://t.me/Give_Me_Heart) 61 | ┣★ ʙᴏᴛ ᴜᴘᴅᴀᴛᴇs [ᴏᴜʀ ᴏᴛʜᴇʀ ʙᴏᴛs](https://t.me/AsadSupport) 62 | ┣★ ᴀʟᴇxᴀ ғᴇᴅ [ғᴇᴅ ʟᴏɢs](https://t.me/AlexaFed_Logs) 63 | ┣★ sᴏᴜʀᴄᴇ ᴄᴏᴅᴇ : [ᴄʟɪᴄᴋ ʜᴇʀᴇ](https://github.com/TheTeamAlexa/AlexaAiMachineBot) 64 | ┣★ ɴᴇᴛᴡᴏʀᴋ [ʀᴏᴄᴋs](https://t.me/Shayri_Music_Lovers) 65 | ┗━━━━━━━━━━━━━━━━━┛ 66 | 💞 67 | IF HAVE ANY QUESTION THEN CONTACT » TO » MY » [OWNER] @Jankari_Ki_Duniya""", 68 | ) 69 | 70 | 71 | @client.on_message( 72 | filters.command("alive", prefixes=["/", ".", "?", "-"]) 73 | & ~filters.private) 74 | async def start(client, message): 75 | await message.reply_text(f"**ᴀʟᴇxᴀ ᴀɪ ᴜsᴇʀʙᴏᴛ ғᴏʀ ᴄʜᴀᴛᴛɪɴɢ ɪs ᴡᴏʀᴋɪɴɢ**") 76 | 77 | @client.on_message( 78 | filters.command("chatbot off", prefixes=["/", ".", "?", "-"]) 79 | & ~filters.private) 80 | async def chatbotofd(client, message): 81 | alexadb = MongoClient(MONGO_URL) 82 | alexa = alexadb["AlexaDb"]["Alexa"] 83 | if message.from_user: 84 | user = message.from_user.id 85 | chat_id = message.chat.id 86 | if user not in ( 87 | await is_admins(chat_id) 88 | ): 89 | return await message.reply_text( 90 | "" 91 | ) 92 | is_alexa = alexa.find_one({"chat_id": message.chat.id}) 93 | if not is_alexa: 94 | alexa.insert_one({"chat_id": message.chat.id}) 95 | await message.reply_text(f"ᴄʜᴀᴛʙɪᴛ ɪs ᴅɪsᴀʙʟᴇᴅ ʙʏ {message.from_user.mention()} ғᴏʀ ᴜsᴇʀs ɪɴ {message.chat.title}") 96 | if is_alexa: 97 | await message.reply_text(f"ᴄʜᴀᴛʙɪᴛ ɪs ᴀʟʀᴇᴀᴅʏ ᴅɪsᴀʙʟᴇᴅ") 98 | 99 | 100 | @client.on_message( 101 | filters.command("chatbot on", prefixes=["/", ".", "?", "-"]) 102 | & ~filters.private) 103 | async def chatboton(client, message): 104 | alexadb = MongoClient(MONGO_URL) 105 | alexa = alexadb["AlexaDb"]["Alexa"] 106 | if message.from_user: 107 | user = message.from_user.id 108 | chat_id = message.chat.id 109 | if user not in ( 110 | await is_admins(chat_id) 111 | ): 112 | return await message.reply_text( 113 | "ʏᴏᴜ ᴀʀᴇ ɴᴏᴛ ᴀᴅᴍɪɴ" 114 | ) 115 | is_alexa = alexa.find_one({"chat_id": message.chat.id}) 116 | if not is_alexa: 117 | await message.reply_text(f"ᴄʜᴀᴛʙɪᴛ ɪs ᴀʟʀᴇᴀᴅʏ ᴇɴᴀʙʟᴇᴅ") 118 | if is_alexa: 119 | alexa.delete_one({"chat_id": message.chat.id}) 120 | await message.reply_text(f"ᴄʜᴀᴛʙɪᴛ ɪs ᴇɴᴀʙʟᴇᴅ ʙʏ {message.from_user.mention()} ғᴏʀ ᴜsᴇʀs ɪɴ {message.chat.title}") 121 | 122 | 123 | @client.on_message( 124 | filters.command("chatbot", prefixes=["/", ".", "?", "-"]) 125 | & ~filters.private) 126 | async def chatbot(client, message): 127 | await message.reply_text(f"**ᴜsᴇᴀɢᴇ:**\n/chatbot [on|off] ᴏɴʟʏ ɢʀᴏᴜᴘ") 128 | 129 | 130 | @client.on_message( 131 | ( 132 | filters.text 133 | | filters.sticker 134 | ) 135 | & ~filters.private 136 | & ~filters.me 137 | & ~filters.bot, 138 | ) 139 | async def alexaai(client: Client, message: Message): 140 | 141 | chatdb = MongoClient(MONGO_URL) 142 | chatai = chatdb["Word"]["WordDb"] 143 | 144 | if not message.reply_to_message: 145 | alexadb = MongoClient(MONGO_URL) 146 | alexa = alexadb["AlexaDb"]["Alexa"] 147 | is_alexa = alexa.find_one({"chat_id": message.chat.id}) 148 | if not is_alexa: 149 | await client.send_chat_action(message.chat.id, "typing") 150 | K = [] 151 | is_chat = chatai.find({"word": message.text}) 152 | k = chatai.find_one({"word": message.text}) 153 | if k: 154 | for x in is_chat: 155 | K.append(x['text']) 156 | hey = random.choice(K) 157 | is_text = chatai.find_one({"text": hey}) 158 | Yo = is_text['check'] 159 | if Yo == "sticker": 160 | await message.reply_sticker(f"{hey}") 161 | if not Yo == "sticker": 162 | await message.reply_text(f"{hey}") 163 | 164 | if message.reply_to_message: 165 | alexadb = MongoClient(MONGO_URL) 166 | alexa = alexadb["AlexaDb"]["Alexa"] 167 | is_alexa = alexa.find_one({"chat_id": message.chat.id}) 168 | getme = await client.get_me() 169 | user_id = getme.id 170 | if message.reply_to_message.from_user.id == user_id: 171 | if not is_alexa: 172 | await client.send_chat_action(message.chat.id, "typing") 173 | K = [] 174 | is_chat = chatai.find({"word": message.text}) 175 | k = chatai.find_one({"word": message.text}) 176 | if k: 177 | for x in is_chat: 178 | K.append(x['text']) 179 | hey = random.choice(K) 180 | is_text = chatai.find_one({"text": hey}) 181 | Yo = is_text['check'] 182 | if Yo == "sticker": 183 | await message.reply_sticker(f"{hey}") 184 | if not Yo == "sticker": 185 | await message.reply_text(f"{hey}") 186 | if not message.reply_to_message.from_user.id == user_id: 187 | if message.sticker: 188 | is_chat = chatai.find_one({"word": message.reply_to_message.text, "id": message.sticker.file_unique_id}) 189 | if not is_chat: 190 | chatai.insert_one({"word": message.reply_to_message.text, "text": message.sticker.file_id, "check": "sticker", "id": message.sticker.file_unique_id}) 191 | if message.text: 192 | is_chat = chatai.find_one({"word": message.reply_to_message.text, "text": message.text}) 193 | if not is_chat: 194 | chatai.insert_one({"word": message.reply_to_message.text, "text": message.text, "check": "none"}) 195 | 196 | @client.on_message( 197 | ( 198 | filters.sticker 199 | | filters.text 200 | ) 201 | & ~filters.private 202 | & ~filters.me 203 | & ~filters.bot, 204 | ) 205 | async def alexastickerai(client: Client, message: Message): 206 | 207 | chatdb = MongoClient(MONGO_URL) 208 | chatai = chatdb["Word"]["WordDb"] 209 | 210 | if not message.reply_to_message: 211 | alexadb = MongoClient(MONGO_URL) 212 | alexa = alexadb["AlexaDb"]["Alexa"] 213 | is_alexa = alexa.find_one({"chat_id": message.chat.id}) 214 | if not is_alexa: 215 | await client.send_chat_action(message.chat.id, "typing") 216 | K = [] 217 | is_chat = chatai.find({"word": message.sticker.file_unique_id}) 218 | k = chatai.find_one({"word": message.text}) 219 | if k: 220 | for x in is_chat: 221 | K.append(x['text']) 222 | hey = random.choice(K) 223 | is_text = chatai.find_one({"text": hey}) 224 | Yo = is_text['check'] 225 | if Yo == "text": 226 | await message.reply_text(f"{hey}") 227 | if not Yo == "text": 228 | await message.reply_sticker(f"{hey}") 229 | 230 | if message.reply_to_message: 231 | alexadb = MongoClient(MONGO_URL) 232 | alexa = alexadb["AlexaDb"]["Alexa"] 233 | is_alexa = alexa.find_one({"chat_id": message.chat.id}) 234 | getme = await client.get_me() 235 | user_id = getme.id 236 | if message.reply_to_message.from_user.id == user_id: 237 | if not is_alexa: 238 | await client.send_chat_action(message.chat.id, "typing") 239 | K = [] 240 | is_chat = chatai.find({"word": message.text}) 241 | k = chatai.find_one({"word": message.text}) 242 | if k: 243 | for x in is_chat: 244 | K.append(x['text']) 245 | hey = random.choice(K) 246 | is_text = chatai.find_one({"text": hey}) 247 | Yo = is_text['check'] 248 | if Yo == "text": 249 | await message.reply_text(f"{hey}") 250 | if not Yo == "text": 251 | await message.reply_sticker(f"{hey}") 252 | if not message.reply_to_message.from_user.id == user_id: 253 | if message.text: 254 | is_chat = chatai.find_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.text}) 255 | if not is_chat: 256 | toggle.insert_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.text, "check": "text"}) 257 | if message.sticker: 258 | is_chat = chatai.find_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.sticker.file_id}) 259 | if not is_chat: 260 | chatai.insert_one({"word": message.reply_to_message.sticker.file_unique_id, "text": message.sticker.file_id, "check": "none"}) 261 | 262 | 263 | 264 | @client.on_message( 265 | ( 266 | filters.text 267 | | filters.sticker 268 | ) 269 | & filters.private 270 | & ~filters.me 271 | & ~filters.bot, 272 | ) 273 | async def alexaprivate(client: Client, message: Message): 274 | 275 | chatdb = MongoClient(MONGO_URL) 276 | chatai = chatdb["Word"]["WordDb"] 277 | if not message.reply_to_message: 278 | await client.send_chat_action(message.chat.id, "typing") 279 | K = [] 280 | is_chat = chatai.find({"word": message.text}) 281 | for x in is_chat: 282 | K.append(x['text']) 283 | hey = random.choice(K) 284 | is_text = chatai.find_one({"text": hey}) 285 | Yo = is_text['check'] 286 | if Yo == "sticker": 287 | await message.reply_sticker(f"{hey}") 288 | if not Yo == "sticker": 289 | await message.reply_text(f"{hey}") 290 | if message.reply_to_message: 291 | getme = await client.get_me() 292 | user_id = getme.id 293 | if message.reply_to_message.from_user.id == user_id: 294 | await client.send_chat_action(message.chat.id, "typing") 295 | K = [] 296 | is_chat = chatai.find({"word": message.text}) 297 | for x in is_chat: 298 | K.append(x['text']) 299 | hey = random.choice(K) 300 | is_text = chatai.find_one({"text": hey}) 301 | Yo = is_text['check'] 302 | if Yo == "sticker": 303 | await message.reply_sticker(f"{hey}") 304 | if not Yo == "sticker": 305 | await message.reply_text(f"{hey}") 306 | 307 | @client.on_message( 308 | ( 309 | filters.sticker 310 | | filters.text 311 | ) 312 | & filters.private 313 | & ~filters.me 314 | & ~filters.bot, 315 | ) 316 | async def alexaprivatesticker(client: Client, message: Message): 317 | 318 | chatdb = MongoClient(MONGO_URL) 319 | chatai = chatdb["Word"]["WordDb"] 320 | if not message.reply_to_message: 321 | await client.send_chat_action(message.chat.id, "typing") 322 | K = [] 323 | is_chat = chatai.find({"word": message.sticker.file_unique_id}) 324 | for x in is_chat: 325 | K.append(x['text']) 326 | hey = random.choice(K) 327 | is_text = chatai.find_one({"text": hey}) 328 | Yo = is_text['check'] 329 | if Yo == "text": 330 | await message.reply_text(f"{hey}") 331 | if not Yo == "text": 332 | await message.reply_sticker(f"{hey}") 333 | if message.reply_to_message: 334 | getme = await client.get_me() 335 | user_id = getme.id 336 | if message.reply_to_message.from_user.id == user_id: 337 | await client.send_chat_action(message.chat.id, "typing") 338 | K = [] 339 | is_chat = chatai.find({"word": message.sticker.file_unique_id}) 340 | for x in is_chat: 341 | K.append(x['text']) 342 | hey = random.choice(K) 343 | is_text = chatai.find_one({"text": hey}) 344 | Yo = is_text['check'] 345 | if Yo == "text": 346 | await message.reply_text(f"{hey}") 347 | if not Yo == "text": 348 | await message.reply_sticker(f"{hey}") 349 | 350 | 351 | client.run() 352 | --------------------------------------------------------------------------------