DiscordSRV

DiscordSRV

86.8k Downloads

Allow synchronization of a group to membership in a Discord guild (without a role)

trwnh opened this issue · 10 comments

commented

Why?

Back in July 2021 I requested this as #1174 and something completely different got implemented in #1179

What and How?

When a player links their Discord account via /discord link, there should be a way to assign them to a LuckPerms group automatically, without giving them a Discord role.

Are there alternatives?

Not that I'm aware of -- I have tried syncing to the ID of the guild itself as the @everyone role like so:

{"trusted": "518624497780391948"}

But this doesn't work -- players remain in the "default" LP group even after linking their Discord account. I have tried with trusted (the LuckPerms group identifier) and with Member (the "vault group" that shows up in debug, and the display name for the LuckPerms group)

Checks

  • I have used the search at least once to check if my idea has already been suggested and perhaps already implemented.

Anything else

No response

commented

That seems like the opposite of what I want to do. trusted should not be a parent of default; default is already a parent of trusted. (trusted inherits from default.)

Nonetheless, I tried in both directions and it still didn't work -- linking a Discord account keeps that player in the default group and doesn't move them to trusted. The command you posted would work if I only wanted permissions (as it does make it so that default can inherit from trusted within that context), but I have a lot of extra functionality tied to the primary group specifically, so what I need is group <-> membership synchronization. Much like how synchronization.yml allows defining GroupRoleSynchronizationGroupsAndRolesToSync currently, I'd like to ideally be able to define some mapping based on membership instead (GroupMembershipSynchronizationGroupsAndGuildsToSync?)

Synchronization to the @everyone role doesn't seem to be an option, per #1174 (comment)

The public role (@everyone) isn't considered a role that members "have," it's always implied. It wouldn't work with group synchronization.

Again, to clarify, I am explicitly only interested in group synchronization to guild membership, without roles. I don't know how much clearer I can express this feature request.

commented

If you adjust the weighting of the groups you can (I think) make it the primary group. In any event though this is something that should be continued in the discord server where we have luckperms experts who can help get this set up for you.

commented

Workaround:

  • In LuckPerms/config.yml, change primary-group-calculation from parents-by-weight to all-parents-by-weight (so that indirect inheritance works)
  • For each LuckPerms Group, ensure that the prefix meta weight mirrors the group weight (so group with weight=2 should have the node prefix.2.whatever set)
  • Unset the lower group as parent (i.e. remove default from trusted so that trusted no longer inherits all of default)
  • Set the higher group as the parent with discordsrv:server_id context (i.e. add trusted as a contextual parent of default, so default inherits indirectly from trusted but only within the specific context)

Caveats:

  • Players remain in the default group as their parent, so this will interfere with tracks and promotions/demotions
    • Workaround: either do not use tracks, or set up tracks for a completely different purpose than whatever you're using guild membership for?

Overall, this workaround should be suitable if you don't care strictly about parent groups, and only care about the primary group.

I'd still like to see an easier way of doing all this if possible, though.

commented

We use the issue tracker exclusively for bug reports and feature requests. However, this issue appears to be a support request. Please join our Discord at https://discordsrv.com/discord and go to the #support channel for help with installing or configuring DiscordSRV.

commented

No, this is a feature request

commented

This is already possible. If you cared to follow the bots instructions and asked in the discord you would be shown how.

commented

/lp group default parent add trusted discordsrv:server_id=123456789

commented

I did ask in Discord hours ago, and there doesn't seem to be a way to do this. Hence why I filed the feature request, specifically for the case of checking membership instead of assigned roles.

To be clear: I do not wish to synchronize to a role, as GroupRoleSynchronizationGroupsAndRolesToSync makes possible. I wish to synchronize to membership in a guild.

There is a discordsrv:server_id=... LuckPerms context, which is not a solution either.

commented

Why isn’t the server_id context a solution?

commented

Can you automatically assign a group based on an LP context? The only way I see to use the LP context would be to add it to every single permission I wanted linked members to have, which is tedious and also not what I'm asking for (as it wouldn't change their group name, chat prefix, etc. automatically)