Skip to content

Enhancement: Make welcome message configurable #67

@JacobCoffee

Description

@JacobCoffee

Summary

The member join event for a guild should be configurable by server owners.

Basic Example

Here:

byte/src/byte/bot.py

Lines 95 to 104 in e69751b

async def on_member_join(self, member: Member) -> None:
"""Handle member join event.
Args:
member: Member object.
"""
await member.send(
f"Welcome to {member.guild.name}! Please make sure to read the rules if you haven't already. "
f"Feel free to ask any questions you have in the help channel."
)
should be updated to something like:

guild_service = await anext(provides_guilds_service(db_session))
_guild = await guild_server.get(pk=context.guild.id)
if _guild.welcome_members:
    await member.send(
        f"Welcome to {member.guild.name}! {_guild_.welcome_message}"
    )

and models.py:Guilds would have these fields added:

welcome_members: Mapped[bool] = mapped_column(default=True)
welcome_message: Mapped[str] = mapped_column(String(500), default="Please make sure to read the rules if you "
                                                                  "haven't already. Feel free to ask any "
                                                                  "questions you have in the help channel.")

Drawbacks and Impact

No response

Unresolved questions

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    byte 🤖Related to the Byte bot servicedatabase 📦Related to the Byte database serviceenhancement ➕This is a brand new feature or requestgood first issue 🥈Good for newcomershelp wanted 🆘Extra attention is needed

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions