File size: 6,330 Bytes
a8e9b84 |
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 |
from pyrogram import Client
import config
from ..logging import LOGGER
assistants = []
assistantids = []
class Userbot(Client):
def __init__(self):
self.one = Client(
name="AnonXAss1",
api_id=config.API_ID,
api_hash=config.API_HASH,
session_string=str(config.STRING1),
no_updates=True,
)
self.two = Client(
name="AnonXAss2",
api_id=config.API_ID,
api_hash=config.API_HASH,
session_string=str(config.STRING2),
no_updates=True,
)
self.three = Client(
name="AnonXAss3",
api_id=config.API_ID,
api_hash=config.API_HASH,
session_string=str(config.STRING3),
no_updates=True,
)
self.four = Client(
name="AnonXAss4",
api_id=config.API_ID,
api_hash=config.API_HASH,
session_string=str(config.STRING4),
no_updates=True,
)
self.five = Client(
name="AnonXAss5",
api_id=config.API_ID,
api_hash=config.API_HASH,
session_string=str(config.STRING5),
no_updates=True,
)
async def start(self):
LOGGER(__name__).info(f"Starting Assistants...")
if config.STRING1:
await self.one.start()
try:
await self.one.join_chat("dragbackup")
await self.one.join_chat("dragbackup")
except:
pass
assistants.append(1)
try:
await self.one.send_message(config.LOGGER_ID, "Assistant Started")
except:
LOGGER(__name__).error(
"Assistant Account 1 has failed to access the log Group. Make sure that you have added your assistant to your log group and promoted as admin!"
)
exit()
self.one.id = self.one.me.id
self.one.name = self.one.me.mention
self.one.username = self.one.me.username
assistantids.append(self.one.id)
LOGGER(__name__).info(f"Assistant Started as {self.one.name}")
if config.STRING2:
await self.two.start()
try:
await self.two.join_chat("dragbackup")
await self.two.join_chat("dragbackup")
except:
pass
assistants.append(2)
try:
await self.two.send_message(config.LOGGER_ID, "Assistant Started")
except:
LOGGER(__name__).error(
"Assistant Account 2 has failed to access the log Group. Make sure that you have added your assistant to your log group and promoted as admin!"
)
exit()
self.two.id = self.two.me.id
self.two.name = self.two.me.mention
self.two.username = self.two.me.username
assistantids.append(self.two.id)
LOGGER(__name__).info(f"Assistant Two Started as {self.two.name}")
if config.STRING3:
await self.three.start()
try:
await self.three.join_chat("dragbackup")
await self.three.join_chat("dragbackup")
except:
pass
assistants.append(3)
try:
await self.three.send_message(config.LOGGER_ID, "Assistant Started")
except:
LOGGER(__name__).error(
"Assistant Account 3 has failed to access the log Group. Make sure that you have added your assistant to your log group and promoted as admin! "
)
exit()
self.three.id = self.three.me.id
self.three.name = self.three.me.mention
self.three.username = self.three.me.username
assistantids.append(self.three.id)
LOGGER(__name__).info(f"Assistant Three Started as {self.three.name}")
if config.STRING4:
await self.four.start()
try:
await self.four.join_chat("dragbackup")
await self.four.join_chat("dragbackup")
except:
pass
assistants.append(4)
try:
await self.four.send_message(config.LOGGER_ID, "Assistant Started")
except:
LOGGER(__name__).error(
"Assistant Account 4 has failed to access the log Group. Make sure that you have added your assistant to your log group and promoted as admin! "
)
exit()
self.four.id = self.four.me.id
self.four.name = self.four.me.mention
self.four.username = self.four.me.username
assistantids.append(self.four.id)
LOGGER(__name__).info(f"Assistant Four Started as {self.four.name}")
if config.STRING5:
await self.five.start()
try:
await self.five.join_chat("dragbackup")
await self.five.join_chat("dragbackup")
except:
pass
assistants.append(5)
try:
await self.five.send_message(config.LOGGER_ID, "Assistant Started")
except:
LOGGER(__name__).error(
"Assistant Account 5 has failed to access the log Group. Make sure that you have added your assistant to your log group and promoted as admin! "
)
exit()
self.five.id = self.five.me.id
self.five.name = self.five.me.mention
self.five.username = self.five.me.username
assistantids.append(self.five.id)
LOGGER(__name__).info(f"Assistant Five Started as {self.five.name}")
async def stop(self):
LOGGER(__name__).info(f"Stopping Assistants...")
try:
if config.STRING1:
await self.one.stop()
if config.STRING2:
await self.two.stop()
if config.STRING3:
await self.three.stop()
if config.STRING4:
await self.four.stop()
if config.STRING5:
await self.five.stop()
except:
pass
|