fix(twitch): Fix followage and whisper ctxvars.
This commit is contained in:
+7
-7
@@ -25,21 +25,21 @@ 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 ctx.bot.user.send_whisper(to_user=self.user, message=message)
|
||||
|
||||
async def _exec_attr_followage(self, ctx, channel: twitchio.PartialUser):
|
||||
async def _exec_attr_followage(self, ctx, channel: "CustomCmdUser"):
|
||||
followed_at = None
|
||||
query = await channel.fetch_followers(user=self.user)
|
||||
query = await channel.user.fetch_followers(
|
||||
user=self.user, token_for=ctx.bot.user
|
||||
)
|
||||
async for follower in query.followers:
|
||||
followed_at = follower.followed_at
|
||||
|
||||
if followed_at:
|
||||
durstr = strfdelta(utc_now() - followed_at)
|
||||
resp = (
|
||||
f"{self.user.mention} has been following {channel.mention} for {durstr}"
|
||||
)
|
||||
return durstr
|
||||
else:
|
||||
return f"{self.user.mention} is not following {channel.mention}"
|
||||
return None
|
||||
|
||||
@classmethod
|
||||
def from_user(cls, user: twitchio.PartialUser):
|
||||
|
||||
Reference in New Issue
Block a user