39 lines
1.3 KiB
Python
39 lines
1.3 KiB
Python
# _____ _
|
|
# / ____| (_)
|
|
# | (___ ___ __ _ _____ ___ _ __ ___ _ __ ___ ___ _ __
|
|
# \___ \ / _ \/ _` / __\ \ /\ / / | '_ ` _ \| '_ ` _ \ / _ \ '__|
|
|
# ____) | __/ (_| \__ \\ 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, )
|