Skip to content

Commit

Permalink
automated uvloop installation
Browse files Browse the repository at this point in the history
  • Loading branch information
iamgojoof6eyes committed Nov 24, 2024
1 parent 057eba6 commit dd71e51
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
17 changes: 15 additions & 2 deletions Powers/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,19 @@
# import uvloop # Comment it out if using on windows
import os
from platform import system

from Powers import LOGGER
from Powers.bot_class import Gojo

if __name__ == "__main__":
# uvloop.install() # Comment it out if using on windows
if system() == "Windows":
LOGGER.info("Windows system detected thus not installing uvloop")
else:
LOGGER.info("Attempting to install uvloop")
try:
os.system("pip3 install uvloop==0.19.0")
import uvloop
uvloop.install()
LOGGER.info("Installed uvloop continuing the process")
except:
LOGGER.info("Failed to install uvloop continuing the process")
Gojo().run()
2 changes: 1 addition & 1 deletion Powers/plugins/afk.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ async def get_hours(hour: str):
return txt


@Gojo.on_message(afk_filter & filters.group, 10000)
@Gojo.on_message(afk_filter & filters.group)
async def afk_checker(c: Gojo, m: Message):
afk = AFK()
back_ = choice(back)
Expand Down
3 changes: 2 additions & 1 deletion Powers/utils/custom_filters.py
Original file line number Diff line number Diff line change
Expand Up @@ -332,12 +332,13 @@ async def afk_check_filter(_, __, m: Message):
if repl_user := m.reply_to_message.from_user:
repl_user = m.reply_to_message.from_user.id
is_repl_afk = afk.check_afk(chat, repl_user)
return bool(is_repl_afk)

user = m.from_user.id

is_afk = afk.check_afk(chat, user)

return bool((is_afk or is_repl_afk))
return bool(is_afk)


async def flood_check_filter(_, __, m: Message):
Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ tswift==0.7.0
typing-extensions
ujson==5.8.0
Unidecode
uvloop==0.19.0
wikipedia==1.4.0
youtube-search-python==1.6.6
yt-dlp@git+https://github.com/HellBoy-OP/yt-dp-fork.git@af1fd12f675220df6793fc019dff320bc76e8080

0 comments on commit dd71e51

Please sign in to comment.