Search code examples
pythondiscorddiscord.pybots

Boost message with discord.py


I am trying to make a custom discord bot with discord.py and I want to make a boost message. When someone boosts the server it will send a message at a specific channel, How can I do that?

I have no idea how to do it. I couldn't even find any documentation or article about it.


Solution

  • So, there is no special event but we can make this happen by checking if the user have server booster role enter image description here and then check if that role is being added using the on_member_update event. Here's an example:

    @bot.event
    async def on_member_update(before, after):
        if 'Server Booster' in after.roles:
            if not 'Server Booster' in str(before.roles):
                print(f"{after} has boosted the server ({after.guild}).")