inspect bug fixes.
This commit is contained in:
@@ -61,9 +61,9 @@ class BOT(Client):
|
||||
@staticmethod
|
||||
def add_cmd(cmd: str | list):
|
||||
def the_decorator(func):
|
||||
path = inspect.stack()[1][1]
|
||||
@wraps(func)
|
||||
def wrapper():
|
||||
path = inspect.stack()[1][1]
|
||||
if isinstance(cmd, list):
|
||||
for _cmd in cmd:
|
||||
Config.CMD_DICT[_cmd] = {"func": func, "path": path}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import inspect
|
||||
import sys
|
||||
import traceback
|
||||
from io import StringIO
|
||||
@@ -51,4 +52,4 @@ async def executor(bot: bot, message: Message) -> Message | None:
|
||||
|
||||
|
||||
if Config.DEV_MODE:
|
||||
Config.CMD_DICT["exec"] = executor
|
||||
Config.CMD_DICT["exec"] = {"func": executor, "path":inspect.stack()[0][1]}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import importlib
|
||||
import inspect
|
||||
import sys
|
||||
import traceback
|
||||
|
||||
@@ -26,4 +27,4 @@ async def loader(bot: bot, message: Message) -> Message | None:
|
||||
|
||||
|
||||
if Config.DEV_MODE:
|
||||
Config.CMD_DICT["load"] = loader
|
||||
Config.CMD_DICT["load"] ={"func": loader, "path":inspect.stack()[0][1]}
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import asyncio
|
||||
import inspect
|
||||
|
||||
from pyrogram.enums import ParseMode
|
||||
|
||||
@@ -52,5 +53,5 @@ async def live_shell(bot: bot, message: Message) -> Message | None:
|
||||
|
||||
|
||||
if Config.DEV_MODE:
|
||||
Config.CMD_DICT["shell"] = live_shell
|
||||
Config.CMD_DICT["sh"] = run_cmd
|
||||
Config.CMD_DICT["shell"] ={"func": live_shell, "path":inspect.stack()[0][1]}
|
||||
Config.CMD_DICT["sh"] = {"func": run_cmd, "path":inspect.stack()[0][1]}
|
||||
|
||||
Reference in New Issue
Block a user