Compare commits

..

No commits in common. "4bd296d52a7fd502fc52a8ae37a4df892a13d8db" and "f222aedd778ecb5dcc285fe9a2ed80e9eca8462d" have entirely different histories.

2 changed files with 2 additions and 25 deletions

View file

@ -7,9 +7,6 @@ assignees: ''
--- ---
**What cog is your feature request for?**
A cog in this repository.
**Is your feature request related to a problem? Please describe.** **Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

View file

@ -12,7 +12,6 @@ class Shortmute(commands.Cog):
self.config = Config.get_conf(self, identifier=25781647388294, force_registration=True) self.config = Config.get_conf(self, identifier=25781647388294, force_registration=True)
self.config.register_guild( self.config.register_guild(
dm = True, dm = True,
confirm = True,
logging_channels = [], logging_channels = [],
immune_roles = [], immune_roles = [],
blacklisted_users = [] blacklisted_users = []
@ -20,7 +19,7 @@ class Shortmute(commands.Cog):
@app_commands.command() @app_commands.command()
@app_commands.rename(target='member') @app_commands.rename(target='member')
async def shortmute(self, interaction: discord.Interaction, target: discord.Member, duration: int, reason: str, evidence_link: str = None, evidence_image: discord.Attachment = None, skip_confirmation: bool = None): async def shortmute(self, interaction: discord.Interaction, target: discord.Member, duration: int, reason: str, evidence_link: str = None, evidence_image: discord.Attachment = None, skip_confirmation: bool = True):
"""Shortmute someone for up to 30m. """Shortmute someone for up to 30m.
Parameters Parameters
@ -35,7 +34,7 @@ class Shortmute(commands.Cog):
An image link to evidence for the shortmute, do not use with evidence_image An image link to evidence for the shortmute, do not use with evidence_image
evidence_image: discord.Attachment = None evidence_image: discord.Attachment = None
An image file used as evidence for the shortmute, do not use with evidence_link An image file used as evidence for the shortmute, do not use with evidence_link
skip_confirmation: bool = None skip_confirmation: bool = True
This allows you skip the confirmation prompt and immediately shortmute the user. This allows you skip the confirmation prompt and immediately shortmute the user.
""" """
disable_dateutil() disable_dateutil()
@ -49,8 +48,6 @@ class Shortmute(commands.Cog):
evidence = str(evidence_image) evidence = str(evidence_image)
else: else:
evidence = None evidence = None
if skip_confirmation is None:
skip_confirmation = await self.config.guild(interaction.guild).confirm()
passed_info = { passed_info = {
"target": target, "target": target,
"timedelta": timedelta, "timedelta": timedelta,
@ -323,20 +320,3 @@ class Shortmute(commands.Cog):
else: else:
await self.config.guild(ctx.guild).dm.set(enabled) await self.config.guild(ctx.guild).dm.set(enabled)
await ctx.send(content=f"Shortmute Direct Message setting changed!\nOld value: `{old_value}`\nNew value: `{enabled}`") await ctx.send(content=f"Shortmute Direct Message setting changed!\nOld value: `{old_value}`\nNew value: `{enabled}`")
@shortmute_config.command(name='confirmation')
@commands.guild_only()
@commands.admin()
async def shortmute_config_confirmation(self, ctx: commands.Context, enabled: bool = None):
"""Manages if /shortmute has a confirmation prompt by default.
Parameters
------------
enabled: bool (optional)
This parameter, if set, will toggle this setting to either True or False."""
old_value = await self.config.guild(ctx.guild).confirm()
if enabled is None:
await ctx.send(content=f"Shortmute Confirmations are currently {'enabled' if old_value else 'disabled'} by default!")
else:
await self.config.guild(ctx.guild).confirm.set(enabled)
await ctx.send(content=f"Shortmute Confirmation setting changed!\nOld value: `{old_value}`\nNew value: `{enabled}`")