(self)
| 35 | |
| 36 | |
| 37 | async def start(self): |
| 38 | await super().start() |
| 39 | me = await self.get_me() |
| 40 | self.mention = me.mention |
| 41 | self.username = me.username |
| 42 | self.uptime = Config.BOT_UPTIME |
| 43 | self.premium = Config.PREMIUM_MODE |
| 44 | self.uploadlimit = Config.UPLOAD_LIMIT_MODE |
| 45 | Config.BOT = self |
| 46 | |
| 47 | app = aiohttp.web.AppRunner(await web_server()) |
| 48 | await app.setup() |
| 49 | bind_address = "0.0.0.0" |
| 50 | await aiohttp.web.TCPSite(app, bind_address, Config.PORT).start() |
| 51 | |
| 52 | path = "plugins/*.py" |
| 53 | files = glob.glob(path) |
| 54 | for name in files: |
| 55 | with open(name) as a: |
| 56 | patt = Path(a.name) |
| 57 | plugin_name = patt.stem.replace(".py", "") |
| 58 | plugins_path = Path(f"plugins/{plugin_name}.py") |
| 59 | import_path = "plugins.{}".format(plugin_name) |
| 60 | spec = importlib.util.spec_from_file_location(import_path, plugins_path) |
| 61 | load = importlib.util.module_from_spec(spec) |
| 62 | spec.loader.exec_module(load) |
| 63 | sys.modules["plugins" + plugin_name] = load |
| 64 | print("Digital Botz Imported " + plugin_name) |
| 65 | |
| 66 | print(f"{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️") |
| 67 | |
| 68 | |
| 69 | if Config.ADMIN: |
| 70 | if Config.STRING_SESSION: |
| 71 | try: await self.send_message(Config.ADMIN, f"𝟮𝗚𝗕+ ғɪʟᴇ sᴜᴘᴘᴏʀᴛ ʜᴀs ʙᴇᴇɴ ᴀᴅᴅᴇᴅ ᴛᴏ ʏᴏᴜʀ ʙᴏᴛ.\n\nNote: 𝐓𝐞𝐥𝐞𝐠𝐫𝐚𝐦 𝐩𝐫𝐞𝐦𝐢𝐮𝐦 𝐚𝐜𝐜𝐨𝐮𝐧𝐭 𝐬𝐭𝐫𝐢𝐧𝐠 𝐬𝐞𝐬𝐬𝐢𝐨𝐧 𝐫𝐞𝐪𝐮𝐢𝐫𝐞𝐝 𝐓𝐡𝐞𝐧 𝐬𝐮𝐩𝐩𝐨𝐫𝐭𝐬 𝟐𝐆𝐁+ 𝐟𝐢𝐥𝐞𝐬.\n\n**__{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️__**") |
| 72 | except: pass |
| 73 | else: |
| 74 | try: await self.send_message(Config.ADMIN, f"𝟮𝗚𝗕- ғɪʟᴇ sᴜᴘᴘᴏʀᴛ ʜᴀs ʙᴇᴇɴ ᴀᴅᴅᴇᴅ ᴛᴏ ʏᴏᴜʀ ʙᴏᴛ.\n\n**__{me.first_name} Iꜱ Sᴛᴀʀᴛᴇᴅ.....✨️__**") |
| 75 | except: pass |
| 76 | |
| 77 | if Config.LOG_CHANNEL: |
| 78 | try: |
| 79 | curr = datetime.datetime.now(pytz.timezone("Asia/Kolkata")) |
| 80 | date = curr.strftime('%d %B, %Y') |
| 81 | time = curr.strftime('%I:%M:%S %p') |
| 82 | await self.send_message(Config.LOG_CHANNEL, f"**__{me.mention} Iꜱ Rᴇsᴛᴀʀᴛᴇᴅ !!**\n\n📅 Dᴀᴛᴇ : `{date}`\n⏰ Tɪᴍᴇ : `{time}`\n🌐 Tɪᴍᴇᴢᴏɴᴇ : `Asia/Kolkata`\n\n🉐 Vᴇʀsɪᴏɴ : `v{__version__} (Layer {layer})`</b>") |
| 83 | except: |
| 84 | print("Pʟᴇᴀꜱᴇ Mᴀᴋᴇ Tʜɪꜱ Iꜱ Aᴅᴍɪɴ Iɴ Yᴏᴜʀ Lᴏɢ Cʜᴀɴɴᴇʟ") |
| 85 | |
| 86 | async def stop(self, *args): |
| 87 | if Config.ADMIN: |
no test coverage detected