mirror of
https://github.com/osmarks/autobotrobot
synced 2025-01-23 13:46:52 +00:00
change heavserver role assignment
This commit is contained in:
parent
c4fdf3d17a
commit
e781477f1a
@ -7,16 +7,7 @@ def setup(bot):
|
||||
@bot.listen()
|
||||
async def on_member_join(member):
|
||||
if member.guild.id == util.config["heavserver"]["id"]:
|
||||
logging.info("%s (%d) joined heavserver", member.name, member.id)
|
||||
logging.info("%s (%d) joined heavserver", member.display_name, member.id)
|
||||
if member.bot:
|
||||
print(member.guild, member.guild.roles)
|
||||
await member.add_roles(discord.utils.get(member.guild.roles, id=util.config["heavserver"]["quarantine_role"]))
|
||||
mod_roles = set()
|
||||
can_add = util.config["heavserver"]["moderator_roles"][:]
|
||||
while True:
|
||||
x = random.choice(can_add)
|
||||
role = discord.utils.get(member.guild.roles, id=x)
|
||||
mod_roles.add(role)
|
||||
can_add.remove(x)
|
||||
if random.randint(0, 3) != 0 or len(can_add) == 0: break
|
||||
await member.add_roles(*mod_roles)
|
||||
await member.add_roles(discord.utils.get(member.guild.roles, id=random.choice(util.config["heavserver"]["moderator_roles"][:])))
|
Loading…
Reference in New Issue
Block a user