Fix erroneous DMs for non-admin commands in admin cogs
This commit is contained in:
parent
a68b9fd8f2
commit
7af0b765f8
1 changed files with 2 additions and 1 deletions
|
@ -21,6 +21,7 @@ from jarvis_core.db.models import (
|
|||
from jarvis.utils import build_embed
|
||||
|
||||
MODLOG_LOOKUP = {"Ban": Ban, "Kick": Kick, "Mute": Mute, "Warning": Warning}
|
||||
IGNORE_COMMANDS = {"Ban": ["bans"], "Kick": [], "Mute": ["unmute"], "Warning": ["warnings"]}
|
||||
|
||||
|
||||
class CacheCog(Scale):
|
||||
|
@ -67,7 +68,7 @@ class ModcaseCog(Scale):
|
|||
"""
|
||||
name = self.__name__.replace("Cog", "")
|
||||
|
||||
if name not in ["Lock", "Lockdown", "Purge", "Roleping"]:
|
||||
if name in MODLOG_LOOKUP and ctx.command not in IGNORE_COMMANDS[name]:
|
||||
user = kwargs.pop("user", None)
|
||||
if not user and not ctx.target_id:
|
||||
self.logger.warn(f"Admin action {name} missing user, exiting")
|
||||
|
|
Loading…
Add table
Reference in a new issue