Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multi-Server Support #1609

Open
1 task done
Abadima opened this issue Dec 2, 2023 · 0 comments
Open
1 task done

Multi-Server Support #1609

Abadima opened this issue Dec 2, 2023 · 0 comments

Comments

@Abadima
Copy link

Abadima commented Dec 2, 2023

Why?

Some users may want to have the bot in let's say 3 servers, but also want their members to still be synced regardless which one of those three, a capability such as that could coe in handy.

What and How?

The package in itself doesn't seem very friendly to more than one server, for LuckPerms context for example, inputting a role_id that isn't from the "main server" seems to not work.

This URL goes to PlaceholderAPI that seems to only be friendly with MainServer
https://github.com/DiscordSRV/DiscordSRV/blob/master/src/main/java/github/scarsz/discordsrv/hooks/PlaceholderAPIExpansion.java#L138

And here, for LuckPerms, while it checks other servers, it doesn't fetch the roles from them...
https://github.com/DiscordSRV/DiscordSRV/blob/master/src/main/java/github/scarsz/discordsrv/hooks/permissions/LuckPermsHook.java#L176

Are there alternatives?

Simple modification of this code:

        for (Guild guild : DiscordSRV.getPlugin().getJda().getGuilds()) {
            builder.add(CONTEXT_SERVER_ID, guild.getId());
        }

an example of an update could be:

        for (Guild guild : DiscordSRV.getPlugin().getJda().getGuilds()) {
          builder.add(CONTEXT_SERVER_ID, guild.getId());
            for (Role role : guild.getRoles()) {
              if (StringUtils.isBlank(role.getName())) {
                  continue;
              }
              builder.add(CONTEXT_ROLE, role.getName());
              builder.add(CONTEXT_ROLE_ID, role.getId());
          }
      }

and with something like that, we could get rid of the "mainServer" loop altogther, just an idea though...

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant