[3.4] [Help] Let owners set menu reaction timeout (#5205) (#5277)

* initial help reaction timeout with min 15, max 300

* slight wording change

* docs!

* aaa

* Suggestions from code review, thank Jack!

Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

(cherry picked from commit f8664a4e8a)

Co-authored-by: Vexed <vex@vexcodes.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>

Co-authored-by: Vexed <vex@vexcodes.com>
Co-authored-by: jack1142 <6032823+jack1142@users.noreply.github.com>
This commit is contained in:
Red-GitHubBot
2021-09-08 21:55:03 +02:00
committed by GitHub
parent 55712f1ed0
commit dbe50bc6fe
4 changed files with 60 additions and 1 deletions

View File

@@ -3340,6 +3340,32 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
else:
await ctx.send(_("Done. The delete delay has been set to {} seconds.").format(seconds))
@helpset.command(name="reacttimeout")
async def helpset_reacttimeout(self, ctx: commands.Context, seconds: int):
"""Set the timeout for reactions, if menus are enabled.
The default is 30 seconds.
The timeout has to be between 15 and 300 seconds.
**Examples:**
- `[p]helpset reacttimeout 30` - The default timeout.
- `[p]helpset reacttimeout 60` - Timeout of 1 minute.
- `[p]helpset reacttimeout 15` - Minimum allowed timeout.
- `[p]helpset reacttimeout 300` - Max allowed timeout (5 mins).
**Arguments:**
- `<seconds>` - The timeout, in seconds, of the reactions.
"""
if seconds < 15:
await ctx.send(_("You must give a value of at least 15 seconds!"))
return
if seconds > 300:
await ctx.send(_("The timeout cannot be greater than 5 minutes!"))
return
await ctx.bot._config.help.react_timeout.set(seconds)
await ctx.send(_("Done. The reaction timeout has been set to {} seconds.").format(seconds))
@helpset.command(name="tagline")
async def helpset_tagline(self, ctx: commands.Context, *, tagline: str = None):
"""