userlog: allow only accessing a type of events + add .events
This commit is contained in:
parent
9defe42424
commit
b04fdc65ee
1 changed files with 15 additions and 2 deletions
|
@ -79,13 +79,26 @@ class ModUserlog:
|
|||
set_userlog(json.dumps(userlog))
|
||||
return embed
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
@commands.command(aliases=["events"])
|
||||
async def eventtypes(self, ctx):
|
||||
"""Lists the available event types, staff only."""
|
||||
event_list = [f"{et} ({userlog_event_types[et]})" for et in
|
||||
userlog_event_types]
|
||||
event_text = ("Available events:\n``` - " +
|
||||
"\n - ".join(event_list) +
|
||||
"```")
|
||||
await ctx.send(event_text)
|
||||
|
||||
@commands.guild_only()
|
||||
@commands.check(check_if_staff)
|
||||
@commands.command(name="userlog",
|
||||
aliases=["listwarns", "getuserlog", "listuserlog"])
|
||||
async def userlog_cmd(self, ctx, target: discord.Member):
|
||||
async def userlog_cmd(self, ctx, target: discord.Member, event=""):
|
||||
"""Lists the userlog events for a user, staff only."""
|
||||
embed = self.get_userlog_embed_for_id(str(target.id), str(target))
|
||||
embed = self.get_userlog_embed_for_id(str(target.id), str(target),
|
||||
event=event)
|
||||
await ctx.send(embed=embed)
|
||||
|
||||
@commands.guild_only()
|
||||
|
|
Loading…
Reference in a new issue