Home > front end >  Boost message with discord.py
Boost message with discord.py

Time:01-24

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.

CodePudding user response:

There's a couple of ways you could do this:

In the guild settings, you can turn on a toggle that sends a message when someone boosts the guild. You can do your thing off of this message.

Secondly, there's the 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}).")
  • Related