Spaces:
Sleeping
Sleeping
Captain Ezio
commited on
Commit
·
d334531
1
Parent(s):
8cadd1a
automated uvloop installation
Browse files- Powers/__main__.py +15 -2
- Powers/plugins/afk.py +1 -1
- Powers/utils/custom_filters.py +2 -1
- requirements.txt +0 -1
Powers/__main__.py
CHANGED
@@ -1,6 +1,19 @@
|
|
1 |
-
|
|
|
|
|
|
|
2 |
from Powers.bot_class import Gojo
|
3 |
|
4 |
if __name__ == "__main__":
|
5 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
Gojo().run()
|
|
|
1 |
+
import os
|
2 |
+
from platform import system
|
3 |
+
|
4 |
+
from Powers import LOGGER
|
5 |
from Powers.bot_class import Gojo
|
6 |
|
7 |
if __name__ == "__main__":
|
8 |
+
if system() == "Windows":
|
9 |
+
LOGGER.info("Windows system detected thus not installing uvloop")
|
10 |
+
else:
|
11 |
+
LOGGER.info("Attempting to install uvloop")
|
12 |
+
try:
|
13 |
+
os.system("pip3 install uvloop==0.19.0")
|
14 |
+
import uvloop
|
15 |
+
uvloop.install()
|
16 |
+
LOGGER.info("Installed uvloop continuing the process")
|
17 |
+
except:
|
18 |
+
LOGGER.info("Failed to install uvloop continuing the process")
|
19 |
Gojo().run()
|
Powers/plugins/afk.py
CHANGED
@@ -69,7 +69,7 @@ async def get_hours(hour: str):
|
|
69 |
return txt
|
70 |
|
71 |
|
72 |
-
@Gojo.on_message(afk_filter & filters.group
|
73 |
async def afk_checker(c: Gojo, m: Message):
|
74 |
afk = AFK()
|
75 |
back_ = choice(back)
|
|
|
69 |
return txt
|
70 |
|
71 |
|
72 |
+
@Gojo.on_message(afk_filter & filters.group)
|
73 |
async def afk_checker(c: Gojo, m: Message):
|
74 |
afk = AFK()
|
75 |
back_ = choice(back)
|
Powers/utils/custom_filters.py
CHANGED
@@ -332,12 +332,13 @@ async def afk_check_filter(_, __, m: Message):
|
|
332 |
if repl_user := m.reply_to_message.from_user:
|
333 |
repl_user = m.reply_to_message.from_user.id
|
334 |
is_repl_afk = afk.check_afk(chat, repl_user)
|
|
|
335 |
|
336 |
user = m.from_user.id
|
337 |
|
338 |
is_afk = afk.check_afk(chat, user)
|
339 |
|
340 |
-
return bool(
|
341 |
|
342 |
|
343 |
async def flood_check_filter(_, __, m: Message):
|
|
|
332 |
if repl_user := m.reply_to_message.from_user:
|
333 |
repl_user = m.reply_to_message.from_user.id
|
334 |
is_repl_afk = afk.check_afk(chat, repl_user)
|
335 |
+
return bool(is_repl_afk)
|
336 |
|
337 |
user = m.from_user.id
|
338 |
|
339 |
is_afk = afk.check_afk(chat, user)
|
340 |
|
341 |
+
return bool(is_afk)
|
342 |
|
343 |
|
344 |
async def flood_check_filter(_, __, m: Message):
|
requirements.txt
CHANGED
@@ -36,7 +36,6 @@ tswift==0.7.0
|
|
36 |
typing-extensions
|
37 |
ujson==5.8.0
|
38 |
Unidecode
|
39 |
-
uvloop==0.19.0
|
40 |
wikipedia==1.4.0
|
41 |
youtube-search-python==1.6.6
|
42 |
yt-dlp@git+https://github.com/HellBoy-OP/yt-dp-fork.git@af1fd12f675220df6793fc019dff320bc76e8080
|
|
|
36 |
typing-extensions
|
37 |
ujson==5.8.0
|
38 |
Unidecode
|
|
|
39 |
wikipedia==1.4.0
|
40 |
youtube-search-python==1.6.6
|
41 |
yt-dlp@git+https://github.com/HellBoy-OP/yt-dp-fork.git@af1fd12f675220df6793fc019dff320bc76e8080
|