#mass edit role members

1 messages · Page 1 of 1 (latest)

tacit venture
#

Anyone have any experience with making temporary roles and adding members to them in bulk?
Trying to make an alert system that creates a role and fills it with members that needs to be pinged before it self-destructs.
This worked fine in testing since there was only 3 members to choose from. However when i moved it over to the server its going to live in it quickly died when having to add over 100 members to a role.

Was hoping for an api call where i could just supply a list of member id's and send it in one go. But no such luck.
Any ideas?

        for member in role.members:
            if member.id in members_with_kill:
                continue
            await member.add_roles(temp_role)

Theres the offending piece of code, takes several mins to process the 100 or so role_adds

tame patrol
#

there is no way around it

#

youll always get "rate limited" and just have to wait

#

it'll slowly add the roles. it queues what it can't currently add then add them when it can

tacit venture
#

Yeah i noticed, bot got super sluggish

#

Is there a limit to how many mentions you can have in a message?

#

Ill give it a shot before i scrap this entire project lol, other way around it would be to hard bake around 50 roles. which also issnt ideal

ashen merlin
#

REST:
POST Message | 5/5s | per-channel
DELETE Message | 5/1s | per-channel
PUT/DELETE Reaction | 1/0.25s | per-channel
PATCH Channel | 2/600s | per-channel
PATCH Member | 10/10s | per-guild
PATCH Member Nick | 1/1s | per-guild
PATCH Username | 2/3600s | per-account
|All Requests| | 50/1s | per-account
WS:
Gateway Connect | 1/5s | per-account
Presence Update | 5/60s | per-session
|All Sent Messages| | 120/60s | per-session

severe lion
ashen merlin
#

AFAIk yes

severe lion
#

Good to know.

tranquil tendon
#

what is your end goal for this? why is the role created and deleted and doesn't just stay around?

tacit venture
# tranquil tendon what is your end goal for this? why is the role created and deleted and doesn't ...

Diddnt see this before now,
Basically Im part of an achievement hunter discord and there's 44 different rares that people are interrested in.

So idea was that when a rare is tagged in the discord the bot generates a custom role and pings everyone that needs it. It uses a opt in role to collect members. Once you get the kill you can mark it with the bot and you won't get a ping for that rare if it's tagged again

Ideally I would have thought discord had a way to accept a set of users and an action. So you could populate a role in one request. I think it does since when you do it manually in the server settings it seems everything happens in one go with the save button. So went in with the assumption that it was possible to do programmatically too.

Solved for now by instead pumping out messages with around 80 mentions in them and deleting them again.
Discord is probably not too happy about that, but the bot has admin rights in the server so probably won't trigger the anti spam feature and it's only triggered at most 10 times per day. Usually only once or twice.

One negative thing about it is that it punches through the default mute settings so had a few people confused why they got pings even when the server was muted.

tranquil tendon
#

why not just leave the role on?

#

it seems like it's the same people each time

tacit venture
#

Because I don't want to fill the server up with 44 roles