mirror of
https://github.com/brandons209/Red-bot-Cogs.git
synced 2024-09-28 07:11:47 +12:00
fix logs not getting logs for specified channel, and spaces in userinfo
This commit is contained in:
parent
a20153324a
commit
2b8bfa7555
1 changed files with 3 additions and 5 deletions
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue