revolt.py icon indicating copy to clipboard operation
revolt.py copied to clipboard

Example: Auto roles & member editing using revolt.py

Open williamcommu opened this issue 1 year ago • 0 comments

This is used in my current bot, shoutout to bobbobs for suggesting I make it an example. i have an example of configurable auto roles but its alot of bloat-y variables that do other things (like in-text variables and whatnot)

async def on_member_join(self, member: revolt.Member):
    if member.server.id == "SERVER ID":
        role = member.server.get_role("ROLE ID OF ROLE IN SERVER")
        await member.edit(roles=[role])
        channel = Client.get_channel(self, "CHANNEL ID OF CHANNEL IN SERVER")
        await channel.send(f"Welcome {member.mention} to the server!")

williamcommu avatar Nov 29 '24 18:11 williamcommu