JacobCoffee / byte

The Discord bot built for developers
https://byte-bot.app/
MIT License
5 stars 2 forks source link

Enhancement: Make welcome message configurable #67

Open JacobCoffee opened 8 months ago

JacobCoffee commented 8 months ago

Summary

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

Basic Example

Here: https://github.com/JacobCoffee/byte/blob/e69751b27dd3b8b4dae39acd57a3bd67f5fbd27b/src/byte/bot.py#L95-L104 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


[!NOTE]
We utilize Polar.sh to engage in regular as well as pledge-based > sponsorship.

Check out all issues funded or available for funding on our Polar.sh dashboard

  • If you would like to see an issue prioritized, make a pledge towards it!
  • We receive the pledge once the issue is completed & verified
  • This, along with engagement in the community, helps us know which features are a priority to our users.

Fund with Polar