fix(twitch): Fix relative imports
This commit is contained in:
+17
-16
@@ -1,11 +1,11 @@
|
||||
import twitchio
|
||||
|
||||
from customcmd.client import ExecClient
|
||||
from customcmd.data import CustomCmd, CustomCmdData
|
||||
from meta import Bot
|
||||
from utils.lib import utc_now, strfdur
|
||||
|
||||
from ..customcmd.parser import ExecContext
|
||||
from ..customcmd.client import ExecClient
|
||||
from ..customcmd.data import CustomCmd, CustomCmdData
|
||||
from .ctxvars import stuff
|
||||
|
||||
|
||||
@@ -25,10 +25,7 @@ class CustomCmdUser:
|
||||
return self.user.display_name or self.user.name or self.user.id
|
||||
|
||||
async def _exec_attr_whisper(self, ctx, message: str):
|
||||
await self.user.send_whisper(
|
||||
to_user=self.user,
|
||||
message=message
|
||||
)
|
||||
await self.user.send_whisper(to_user=self.user, message=message)
|
||||
|
||||
async def _exec_attr_followage(self, ctx, channel: twitchio.PartialUser):
|
||||
followed_at = None
|
||||
@@ -38,7 +35,9 @@ class CustomCmdUser:
|
||||
|
||||
if followed_at:
|
||||
durstr = strfdur(utc_now() - followed_at)
|
||||
resp = f"{self.user.mention} has been following {channel.mention} for {durstr}"
|
||||
resp = (
|
||||
f"{self.user.mention} has been following {channel.mention} for {durstr}"
|
||||
)
|
||||
else:
|
||||
return f"{self.user.mention} is not following {channel.mention}"
|
||||
|
||||
@@ -51,18 +50,20 @@ class CustomContext(ExecContext):
|
||||
"""
|
||||
CustomCommand ExecContext instantiated from a Twitch message
|
||||
"""
|
||||
|
||||
def __init__(
|
||||
self,
|
||||
bot: Bot,
|
||||
message: twitchio.ChatMessage,
|
||||
alias: str,
|
||||
used_prefix: str,
|
||||
**kwargs):
|
||||
self,
|
||||
bot: Bot,
|
||||
message: twitchio.ChatMessage,
|
||||
alias: str,
|
||||
used_prefix: str,
|
||||
**kwargs,
|
||||
):
|
||||
super().__init__(**kwargs)
|
||||
self.bot = bot
|
||||
self.message = message
|
||||
self.alias = alias
|
||||
self.message = message
|
||||
self.alias = alias
|
||||
self.used_prefix = used_prefix
|
||||
|
||||
self.enter_scope(stuff)
|
||||
# TODO: Need a nice way to define some global functions. Registry pattern?
|
||||
# TODO: Need a nice way to define some global functions. Registry pattern?
|
||||
|
||||
Reference in New Issue
Block a user