Add a setting for adding a tick reaction when help is DMed (#4467)

* Tick response for help command

* Make this a setting instead

Co-authored-by: palmtree5 <palmtree5+3577255@users.noreply.github.com>
This commit is contained in:
palmtree5 2020-10-18 06:10:00 -08:00 committed by GitHub
parent 08bd0567ad
commit ec90199950
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 1 deletions

View File

@ -113,6 +113,7 @@ class RedBase(
help__verify_checks=True, help__verify_checks=True,
help__verify_exists=False, help__verify_exists=False,
help__tagline="", help__tagline="",
help__use_tick=False,
description="Red V3", description="Red V3",
invite_public=False, invite_public=False,
invite_perm=0, invite_perm=0,

View File

@ -76,6 +76,7 @@ class HelpSettings:
verify_exists: bool = False verify_exists: bool = False
tagline: str = "" tagline: str = ""
delete_delay: int = 0 delete_delay: int = 0
use_tick: bool = False
# Contrib Note: This is intentional to not accept the bot object # Contrib Note: This is intentional to not accept the bot object
# There are plans to allow guild and user specific help settings # There are plans to allow guild and user specific help settings
@ -127,6 +128,7 @@ class HelpSettings:
"\nHelp only shows commands which can be used: {verify_checks}" "\nHelp only shows commands which can be used: {verify_checks}"
"\nHelp shows unusable commands when asked directly: {verify_exists}" "\nHelp shows unusable commands when asked directly: {verify_exists}"
"\nDelete delay: {delete_delay}" "\nDelete delay: {delete_delay}"
"\nReact with a checkmark when help is sent via DM: {use_tick}"
"{tagline_info}" "{tagline_info}"
).format_map(data) ).format_map(data)
@ -778,7 +780,8 @@ class RedHelpFormatter(HelpFormatterABC):
) )
else: else:
messages.append(msg) messages.append(msg)
if use_DMs and help_settings.use_tick:
await ctx.tick()
# The if statement takes into account that 'destination' will be # The if statement takes into account that 'destination' will be
# the context channel in non-DM context, reusing 'channel_permissions' to avoid # the context channel in non-DM context, reusing 'channel_permissions' to avoid
# computing the permissions twice. # computing the permissions twice.

View File

@ -2242,6 +2242,22 @@ class Core(commands.commands._RuleDropper, commands.Cog, CoreLogic):
else: else:
await ctx.send(_("Help will filter hidden commands.")) await ctx.send(_("Help will filter hidden commands."))
@helpset.command(name="usetick")
async def helpset_usetick(self, ctx: commands.Context, use_tick: bool = None):
"""
This allows the help command message to be ticked if help is sent in a DM.
Defaults to False.
Using this without a setting will toggle.
"""
if use_tick is None:
use_tick = not await ctx.bot._config.help.use_tick()
await ctx.bot._config.help.use_tick.set(use_tick)
if use_tick:
await ctx.send(_("Help will now tick the command when sent in a DM."))
else:
await ctx.send(_("Help will not tick the command when sent in a DM."))
@helpset.command(name="verifychecks") @helpset.command(name="verifychecks")
async def helpset_permfilter(self, ctx: commands.Context, verify: bool = None): async def helpset_permfilter(self, ctx: commands.Context, verify: bool = None):
""" """