diff --git a/redbot/core/bot.py b/redbot/core/bot.py index 611582439..c5acda519 100644 --- a/redbot/core/bot.py +++ b/redbot/core/bot.py @@ -51,6 +51,7 @@ class RedBase(BotBase): embeds=True, help__page_char_limit=1000, help__max_pages_in_guild=2, + help__tagline="", ) self.db.register_guild( diff --git a/redbot/core/core_commands.py b/redbot/core/core_commands.py index 19f5f7236..350dc8fc0 100644 --- a/redbot/core/core_commands.py +++ b/redbot/core/core_commands.py @@ -876,6 +876,30 @@ class Core: await ctx.bot.db.help.max_pages_in_guild.set(pages) await ctx.send(_("Done. The page limit has been set to {}.").format(pages)) + @helpset.command(name="tagline") + async def helpset_tagline(self, ctx: commands.Context, *, tagline: str = None): + """ + Set the tagline to be used. + + This setting only applies to embedded help. If no tagline is + specified, the default will be used instead. + """ + if tagline is None: + await ctx.bot.db.help.tagline.set("") + return await ctx.send(_("The tagline has been reset.")) + + if len(tagline) > 2048: + await ctx.send( + _( + "Your tagline is too long! Please shorten it to be " + "no more than 2048 characters long." + ) + ) + return + + await ctx.bot.db.help.tagline.set(tagline) + await ctx.send(_("The tagline has been set to {}.").format(tagline[:1900])) + @commands.command() @checks.is_owner() async def listlocales(self, ctx: commands.Context): diff --git a/redbot/core/help_formatter.py b/redbot/core/help_formatter.py index 560ccec20..be969f63e 100644 --- a/redbot/core/help_formatter.py +++ b/redbot/core/help_formatter.py @@ -123,11 +123,7 @@ class Help(formatter.HelpFormatter): """Formats command for output. Returns a dict used to build embed""" - emb = { - "embed": {"title": "", "description": ""}, - "footer": {"text": self.get_ending_note()}, - "fields": [], - } + emb = {"embed": {"title": "", "description": ""}, "footer": {"text": ""}, "fields": []} if self.is_cog(): translator = getattr(self.command, "__translator__", lambda s: s) @@ -146,6 +142,13 @@ class Help(formatter.HelpFormatter): # portion emb["embed"]["description"] = description[:2046] + tagline = await self.context.bot.db.help.tagline() + if tagline: + footer = tagline + else: + footer = self.get_ending_note() + emb["footer"]["text"] = footer + if isinstance(self.command, discord.ext.commands.core.Command): # emb["embed"]["title"] = emb["embed"]["description"]