From 2b8bfa7555e65a4c5e8ee987fca97fcda9e081a4 Mon Sep 17 00:00:00 2001 From: brandons209 Date: Fri, 14 Feb 2020 01:38:00 -0500 Subject: [PATCH] fix logs not getting logs for specified channel, and spaces in userinfo --- activitylog/activitylog.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/activitylog/activitylog.py b/activitylog/activitylog.py index 3d81ca2..5bcb085 100644 --- a/activitylog/activitylog.py +++ b/activitylog/activitylog.py @@ -170,7 +170,7 @@ class ActivityLogger(commands.Cog): @commands.command(aliases=["uinfo"]) @commands.guild_only() @commands.cooldown(rate=1, per=5, type=commands.BucketType.user) - async def userinfo(self, ctx, user: discord.Member = None): + async def userinfo(self, ctx, *, user: discord.Member = None): """ Show information about a user. """ @@ -253,6 +253,8 @@ class ActivityLogger(commands.Cog): await author.send(embed=data) except discord.HTTPException: await ctx.send("Please allow messages from server members to get your info.") + except Exception as e: + print(f"Error in userinfo: {e}") async def userstats(self, guild, user): """ @@ -392,7 +394,6 @@ class ActivityLogger(commands.Cog): return guild = ctx.guild - channel = ctx.channel log_files = sorted(glob.glob(os.path.join(PATH, str(guild.id), "*{}*.log".format(channel.id))), reverse=True) if interval: @@ -428,7 +429,6 @@ class ActivityLogger(commands.Cog): return guild = ctx.guild - channel = ctx.channel log_files = sorted(glob.glob(os.path.join(PATH, str(guild.id), "*{}*.log".format(channel.id))), reverse=True) await self.log_sender(ctx, log_files, end, start=start) @@ -509,7 +509,6 @@ class ActivityLogger(commands.Cog): return guild = ctx.guild - channel = ctx.channel log_files = sorted(glob.glob(os.path.join(PATH, str(guild.id), "*guild*.log")), reverse=True) await self.log_sender(ctx, log_files, end, start=start) @@ -590,7 +589,6 @@ class ActivityLogger(commands.Cog): return guild = ctx.guild - channel = ctx.channel log_files = sorted(glob.glob(os.path.join(PATH, str(guild.id), "*guild*.log")), reverse=True) await self.log_sender(ctx, log_files, end, start=start, user=user)