Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/xdnw/locutus
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Sep 4, 2024
2 parents 382940b + dc6525d commit dbad1a1
Showing 1 changed file with 12 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package link.locutus.discord.commands.manager.v2.impl.pw.commands;

import it.unimi.dsi.fastutil.objects.ObjectArrayList;
import link.locutus.discord.Logg;
import link.locutus.discord.commands.manager.v2.binding.Key;
import link.locutus.discord.commands.manager.v2.binding.LocalValueStore;
import link.locutus.discord.commands.manager.v2.binding.ValueStore;
Expand Down Expand Up @@ -293,6 +294,7 @@ public String runMilitarizationAlerts() {

@Command(desc = "Switch a channel to a subscription channel in multiple servers")
@RolePermission(value = Roles.ADMIN, root = true)
@Ephemeral
public String unsetNews(@Me IMessageIO io, @Me JSONObject command,
GuildSetting setting, Set<GuildDB> guilds, MessageChannel news_channel,
@Switch("e") boolean unset_on_error,
Expand Down Expand Up @@ -409,6 +411,7 @@ public String unsetNews(@Me IMessageIO io, @Me JSONObject command,

@Command(desc = "Bulk unset a guild setting in multiple servers which are invalid based on the provided options")
@RolePermission(value = Roles.ADMIN, root = true)
@Ephemeral
public String unsetKeys(@Me IMessageIO io, @Me JSONObject command,
Set<GuildSetting> settings, Set<GuildDB> guilds,
@Switch("t") boolean unset_cant_talk,
Expand Down Expand Up @@ -563,6 +566,7 @@ public String unsetKeys(@Me IMessageIO io, @Me JSONObject command,

@Command
@RolePermission(value = Roles.ADMIN, root = true)
@Ephemeral
public String infoBulk(@Me GuildDB db, @Me IMessageIO io, GuildSetting setting, Set<GuildDB> guilds, @Switch("s") SpreadSheet sheet) throws GeneralSecurityException, IOException {
if (sheet == null) {
sheet = SpreadSheet.create(db, SheetKey.SETTINGS_SERVERS);
Expand Down Expand Up @@ -681,6 +685,7 @@ private int syncDiscordBans() {
return toAdd.size();
}

@Ephemeral
@Command(desc = "Dump the URL requests to console")
@RolePermission(value = Roles.ADMIN, root = true)
public String showFileQueue(@Me IMessageIO io,
Expand Down Expand Up @@ -1699,6 +1704,7 @@ public String printApiStats(ApiKeyPool keys) {
}

@Command()
@Ephemeral
@RolePermission(value = Roles.ADMIN, root = true)
public String apiUsageStats(@Me DBAlliance alliance) {
ApiKeyPool keys = alliance.getApiKeys();
Expand All @@ -1707,6 +1713,7 @@ public String apiUsageStats(@Me DBAlliance alliance) {
}

@Command(desc = "Import api keys from the guild API_KEY setting, so they can be validated")
@Ephemeral
@RolePermission(value = Roles.ADMIN, root = true)
public String importGuildKeys() {
StringBuilder response = new StringBuilder();
Expand All @@ -1724,7 +1731,8 @@ public String importGuildKeys() {
}
}
}
return "Done!";
Logg.text(response.toString());
return "Done! (see console)";
}

// @Command(desc = "Check if current api keys are valid")
Expand Down Expand Up @@ -1795,6 +1803,7 @@ public String debugPurgeChannels(Category category, @Range(min=60) @Timestamp lo
}

@Command
@Ephemeral
@RolePermission(value = Roles.ADMIN, root = true)
public String listExpiredGuilds(boolean checkMessages) {
StringBuilder response = new StringBuilder();
Expand Down Expand Up @@ -1885,6 +1894,7 @@ public String leaveServer(long guildId) {
}

@Command
@Ephemeral
@RolePermission(value = Roles.ADMIN, root = true)
public String listExpiredOffshores() {
OffshoreInstance offshore = Locutus.imp().getRootBank();
Expand Down Expand Up @@ -2159,6 +2169,7 @@ public String syncForum(@Default Integer sectionId, @Default String sectionName)
}

@Command(desc = "List users in the guild that have provided login credentials to locutus")
@Ephemeral
@RolePermission(value = Roles.ADMIN, root = true)
public String listAuthenticated(@Me GuildDB db) {
List<Member> members = db.getGuild().getMembers();
Expand Down

0 comments on commit dbad1a1

Please sign in to comment.