feat(repo): added help formatters for version numbers to cogs that have them and migrated to using red's inbuilt loggers instead of logging.getLogger

This commit is contained in:
SeaswimmerTheFsh 2024-03-07 03:38:34 -05:00
parent ae31a61436
commit 178a92559c
Signed by untrusted user: cswimr
GPG key ID: B8953EC01E5C4063
6 changed files with 62 additions and 30 deletions

View file

@ -17,12 +17,22 @@ from redbot.core.utils import chat_formatting, common_filters
class Nerdify(commands.Cog):
"""Nerdify your text."""
__author__ = "SeaswimmerTheFsh"
__version__ = "1.3.2"
__author__ = ["SeaswimmerTheFsh"]
__version__ = "1.3.3"
def __init__(self, bot):
self.bot = bot
def format_help_for_context(self, ctx: commands.Context) -> str:
pre_processed = super().format_help_for_context(ctx) or ""
n = "\n" if "\n\n" not in pre_processed else ""
text = [
f"{pre_processed}{n}",
f"Cog Version: **{self.__version__}**",
f"Author: {chat_formatting.humanize_list(self.__author__)}",
]
return "\n".join(text)
@commands.command(aliases=["nerd"])
async def nerdify(
self, ctx: commands.Context, *, text: Optional[str] = None