Allow enforcing reason to be filled in Mod cog commands (#6477)

Co-authored-by: Jakub Kuczys <me@jacken.men>
This commit is contained in:
Kevin Wang
2024-12-23 19:58:57 -05:00
committed by GitHub
parent f0a29e9815
commit 9419f2642a
4 changed files with 81 additions and 0 deletions

View File

@@ -370,6 +370,29 @@ class ModSettings(MixinMeta):
_("Bot will no longer attempt to send a DM to user before kick and ban.")
)
@modset.command()
@commands.guild_only()
async def requirereason(self, ctx: commands.Context, enabled: bool = None):
"""
Toggle whether a reason is required for mod actions.
If this is enabled, the bot will require a reason to be provided for all mod actions.
"""
guild = ctx.guild
if enabled is None:
setting = await self.config.guild(guild).require_reason()
await ctx.send(
_("Mod action reason requirement is currently set to: {setting}").format(
setting=setting
)
)
return
await self.config.guild(guild).require_reason.set(enabled)
if enabled:
await ctx.send(_("Bot will now require a reason for all mod actions."))
else:
await ctx.send(_("Bot will no longer require a reason for all mod actions."))
@modset.command()
@commands.guild_only()
async def defaultdays(self, ctx: commands.Context, days: int = 0):