-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
29 lines (24 loc) · 941 Bytes
/
main.py
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
from pyrogram import idle
import votlx
from mody.Keyboards import start_key
from mody.Redis import db
from mody.get_info import sudo_info, get_bot
from mody.mod import Bot, sudo_client
async def main():
await Bot.start()
if db.get(f'{Bot.me.id}:restart'):
await Bot.send_message(sudo_info.username, '⌯ يمكنك استخدام البوت الان', reply_markup=start_key)
db.delete(f'{Bot.me.id}:restart')
if db.get(f'{get_bot.id}:{sudo_info.id}:session'):
try:
await sudo_client.start()
sudo_client.login = True
except Exception as e:
print(e)
db.delete(f'{get_bot.id}:{sudo_info.id}:session')
print("تم تشغيل البوت بنجاح")
await idle()
await Bot.stop()
print("تم ايقاف البوت بنجاح")
if __name__ == '__main__':
votlx.client.loop.run_until_complete(main())