[Mod] Move deletedelay to core (#3638)

* Move deletedelay to core

* line lengths

* address review

* move settings change

* fine...
This commit is contained in:
TrustyJAID
2020-03-21 11:39:58 -06:00
committed by GitHub
parent d957e44e1e
commit b9f07e8684
6 changed files with 84 additions and 84 deletions

View File

@@ -157,36 +157,6 @@ class ModSettings(MixinMeta):
else:
await ctx.send(_("Repeated messages will be ignored."))
@modset.command()
@commands.guild_only()
async def deletedelay(self, ctx: commands.Context, time: int = None):
"""Set the delay until the bot removes the command message.
Must be between -1 and 60.
Set to -1 to disable this feature.
"""
guild = ctx.guild
if time is not None:
time = min(max(time, -1), 60) # Enforces the time limits
await self.settings.guild(guild).delete_delay.set(time)
if time == -1:
await ctx.send(_("Command deleting disabled."))
else:
await ctx.send(_("Delete delay set to {num} seconds.").format(num=time))
else:
delay = await self.settings.guild(guild).delete_delay()
if delay != -1:
await ctx.send(
_(
"Bot will delete command messages after"
" {num} seconds. Set this value to -1 to"
" stop deleting messages"
).format(num=delay)
)
else:
await ctx.send(_("I will not delete command messages."))
@modset.command()
@commands.guild_only()
async def reinvite(self, ctx: commands.Context):