diff --git a/v6d2ctx/context.py b/v6d2ctx/context.py index 8f70d2a..46f539c 100644 --- a/v6d2ctx/context.py +++ b/v6d2ctx/context.py @@ -13,7 +13,6 @@ class Context: self.message: discord.Message = message self.client: discord.Client = client self.channel: discord.abc.Messageable = message.channel - self.dm_or_text: Union[discord.DMChannel, discord.TextChannel] = message.channel # type: ignore self.author: usertype = message.author self.content: str = message.content self.member: Optional[discord.Member] = message.author if isinstance(message.author, discord.Member) else None diff --git a/v6d2ctx/pain.py b/v6d2ctx/pain.py index f4774c6..ac6a103 100644 --- a/v6d2ctx/pain.py +++ b/v6d2ctx/pain.py @@ -1,4 +1,5 @@ import asyncio +import inspect import os import time @@ -10,7 +11,7 @@ class ALog(Instrumentation): def time(self): return time.time() - self.start - + async def instrument(self, method, *args, **kwargs): key = os.urandom(4).hex() print(f'[{self.time(): 11.3f}] +{key} +A"{self.methodname}"') @@ -27,7 +28,7 @@ class ALog(Instrumentation): class SLog(Instrumentation): def time(self): return time.time() - ALog.start - + def instrument(self, method, *args, **kwargs): key = os.urandom(4).hex() print(f'[{self.time(): 11.3f}] +{key} +S"{self.methodname}"') @@ -43,7 +44,6 @@ class SLog(Instrumentation): class FrameTrace(Instrumentation): async def instrument(self, method, *args, **kwargs): - import inspect frame = inspect.currentframe() while frame is not None: print(frame.f_code.co_filename, frame.f_lineno)