randydev commited on
Commit
d30c25d
·
verified ·
1 Parent(s): 5c69d12

Update Akeno/plugins/eval.py

Browse files
Files changed (1) hide show
  1. Akeno/plugins/eval.py +6 -2
Akeno/plugins/eval.py CHANGED
@@ -8,6 +8,9 @@ import traceback
8
  import subprocess
9
  import pyroaddon
10
  import pyromod
 
 
 
11
  from random import randint
12
  from typing import Optional
13
  from contextlib import suppress
@@ -27,6 +30,7 @@ from pyrogram.raw.functions.messages import GetFullChat
27
  from pyrogram.raw.functions.phone import CreateGroupCall, DiscardGroupCall
28
  from pyrogram.raw.types import InputGroupCall, InputPeerChannel, InputPeerChat
29
 
 
30
  from Akeno.utils.tools import *
31
  from Akeno.utils.handler import *
32
  from Akeno.utils.scripts import get_args, get_args_raw, shell_exec, with_args
@@ -117,11 +121,11 @@ async def shell_handler(_: Client, message: Message):
117
  f'<pre language="sh">{html.escape(cmd_text)}</pre>\n\n'
118
  )
119
 
120
- timeout = db.get("shell", "timeout", 60)
121
  try:
122
  start_time = perf_counter()
123
  rcode, stdout, stderr = await shell_exec(
124
- command=cmd_text, executable=db.get("shell", "executable"), timeout=timeout
125
  )
126
  except asyncio.exceptions.TimeoutError:
127
  text += (
 
8
  import subprocess
9
  import pyroaddon
10
  import pyromod
11
+ import html
12
+ import shutil
13
+ from time import perf_counter
14
  from random import randint
15
  from typing import Optional
16
  from contextlib import suppress
 
30
  from pyrogram.raw.functions.phone import CreateGroupCall, DiscardGroupCall
31
  from pyrogram.raw.types import InputGroupCall, InputPeerChannel, InputPeerChat
32
 
33
+ from Akeno.utils.sql_db import sql_db
34
  from Akeno.utils.tools import *
35
  from Akeno.utils.handler import *
36
  from Akeno.utils.scripts import get_args, get_args_raw, shell_exec, with_args
 
121
  f'<pre language="sh">{html.escape(cmd_text)}</pre>\n\n'
122
  )
123
 
124
+ timeout = sql_db.get("shell", "timeout", 60)
125
  try:
126
  start_time = perf_counter()
127
  rcode, stdout, stderr = await shell_exec(
128
+ command=cmd_text, executable=sql_db.get("shell", "executable"), timeout=timeout
129
  )
130
  except asyncio.exceptions.TimeoutError:
131
  text += (