mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-12-06 17:32:31 -05:00
[V3 Core] Add [p]helpset (#1694)
* Add settings and commands for page and character limits * Add missing returns * Consistent responses
This commit is contained in:
@@ -831,6 +831,51 @@ class Core:
|
||||
ctx.bot.disable_sentry()
|
||||
await ctx.send(_("Done. Sentry logging is now disabled."))
|
||||
|
||||
@commands.group()
|
||||
@checks.is_owner()
|
||||
async def helpset(self, ctx: commands.Context):
|
||||
"""Manage settings for the help command."""
|
||||
if ctx.invoked_subcommand is None:
|
||||
await ctx.send_help()
|
||||
|
||||
@helpset.command(name="pagecharlimit")
|
||||
async def helpset_pagecharlimt(self, ctx: commands.Context, limit: int):
|
||||
"""Set the character limit for each page in the help message.
|
||||
|
||||
This setting only applies to embedded help.
|
||||
|
||||
Please note that setting a relitavely small character limit may
|
||||
mean some pages will exceed this limit. This is because categories
|
||||
are never spread across multiple pages in the help message.
|
||||
|
||||
The default value is 1000 characters.
|
||||
"""
|
||||
if limit <= 0:
|
||||
await ctx.send(_("You must give a positive value!"))
|
||||
return
|
||||
|
||||
await ctx.bot.db.help.page_char_limit.set(limit)
|
||||
await ctx.send(_("Done. The character limit per page has been set to {}.").format(limit))
|
||||
|
||||
@helpset.command(name="maxpages")
|
||||
async def helpset_maxpages(self, ctx: commands.Context, pages: int):
|
||||
"""Set the maximum number of help pages sent in a server channel.
|
||||
|
||||
This setting only applies to embedded help.
|
||||
|
||||
If a help message contains more pages than this value, the help message will
|
||||
be sent to the command author via DM. This is to help reduce spam in server
|
||||
text channels.
|
||||
|
||||
The default value is 2 pages.
|
||||
"""
|
||||
if pages < 0:
|
||||
await ctx.send(_("You must give a value of zero or greater!"))
|
||||
return
|
||||
|
||||
await ctx.bot.db.help.max_pages_in_guild.set(pages)
|
||||
await ctx.send(_("Done. The page limit has been set to {}.").format(pages))
|
||||
|
||||
@commands.command()
|
||||
@checks.is_owner()
|
||||
async def listlocales(self, ctx: commands.Context):
|
||||
|
||||
Reference in New Issue
Block a user