From a62b6d55935328d232be2d07fcff171fb7339d08 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Tue, 26 Mar 2024 03:01:06 -0400 Subject: [PATCH] feat(welcomer): added the welcomer cog --- welcomer/__init__.py | 5 +++++ welcomer/info.json | 17 +++++++++++++++++ welcomer/welcomer.py | 39 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+) create mode 100644 welcomer/__init__.py create mode 100644 welcomer/info.json create mode 100644 welcomer/welcomer.py diff --git a/welcomer/__init__.py b/welcomer/__init__.py new file mode 100644 index 0000000..6be15a7 --- /dev/null +++ b/welcomer/__init__.py @@ -0,0 +1,5 @@ +from .welcomer import Welcomer + + +async def setup(bot): + await bot.add_cog(Welcomer(bot)) diff --git a/welcomer/info.json b/welcomer/info.json new file mode 100644 index 0000000..38730c7 --- /dev/null +++ b/welcomer/info.json @@ -0,0 +1,17 @@ +{ + "author" : ["SeaswimmerTheFsh (seasw.)"], + "install_msg" : "Thank you for installing Nerdify!\nYou can find the source code of this cog [here](https://coastalcommits.com/SeaswimmerTheFsh/SeaCogs). Based off of PhasecoreX's [UwU]() cog.", + "name" : "Nerdify", + "short" : "Nerdify your text!", + "description" : "Nerdify your text!", + "end_user_data_statement" : "This cog does not store end user data.", + "hidden": false, + "disabled": false, + "min_bot_version": "3.5.0", + "min_python_version": [3, 8, 0], + "tags": [ + "fun", + "text", + "meme" + ] +} diff --git a/welcomer/welcomer.py b/welcomer/welcomer.py new file mode 100644 index 0000000..bf1b7c7 --- /dev/null +++ b/welcomer/welcomer.py @@ -0,0 +1,39 @@ +# _____ _ +# / ____| (_) +# | (___ ___ __ _ _____ ___ _ __ ___ _ __ ___ ___ _ __ +# \___ \ / _ \/ _` / __\ \ /\ / / | '_ ` _ \| '_ ` _ \ / _ \ '__| +# ____) | __/ (_| \__ \\ V V /| | | | | | | | | | | | __/ | +# |_____/ \___|\__,_|___/ \_/\_/ |_|_| |_| |_|_| |_| |_|\___|_| + + +from redbot.core import commands, Config +from redbot.core.utils import chat_formatting as cf + + +class Welcomer(commands.Cog): + """Manage welcome messages for new members and leave messages for former members.""" + + __author__ = ["SeaswimmerTheFsh"] + __version__ = "0.1.0" + + def __init__(self, bot): + self.bot = bot + self.config = Config.get_conf(self, identifier=1234567890, force_registration=True) + self.config.register_guild( + welcome_message=None, + leave_message=None, + channel=None, + enabled=False, + ) + + 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: {cf.humanize_list(self.__author__)}", + ] + return "\n".join(text) + + def placeholders(self, )