geforkt von SteamWar/BungeeCore
Fix /bug, Discord Commands
Signed-off-by: Lixfel <git-5w3l@lixfel.de>
Dieser Commit ist enthalten in:
Ursprung
e2024a481b
Commit
dd07603fe3
@ -1 +1 @@
|
||||
Subproject commit 1237a699ba244ecfac65478df34e714afbe2366e
|
||||
Subproject commit d000b8687d93eb43520bbf6685281099055eab9f
|
@ -74,17 +74,17 @@ public class ChannelListener extends ListenerAdapter {
|
||||
if(sender.user().getDiscordId() == null)
|
||||
return;
|
||||
|
||||
VelocityCore.getLogger().log(Level.INFO, "%s -> executed Discord command /%s %s".formatted(sender.user().getUserName(), event.getName(), event.getOption(DiscordBot.ARGUMENT_NAME).getAsString()));
|
||||
SWCommand command = DiscordBot.getCommands().get(event.getName());
|
||||
UserPerm permission = command.getPermission();
|
||||
if(permission != null && !sender.user().perms().contains(permission))
|
||||
return;
|
||||
|
||||
OptionMapping option = event.getOption(DiscordBot.ARGUMENT_NAME);
|
||||
String args = "";
|
||||
if(option != null)
|
||||
args = option.getAsString();
|
||||
|
||||
VelocityCore.getLogger().log(Level.INFO, "%s -> executed Discord command /%s %s".formatted(sender.user().getUserName(), event.getName(), args));
|
||||
SWCommand command = DiscordBot.getCommands().get(event.getName());
|
||||
UserPerm permission = command.getPermission();
|
||||
if(permission != null && !sender.user().perms().contains(permission))
|
||||
return;
|
||||
|
||||
command.execute(sender, args.split(" "));
|
||||
});
|
||||
}
|
||||
|
@ -32,6 +32,7 @@ import net.dv8tion.jda.api.EmbedBuilder;
|
||||
import net.dv8tion.jda.api.MessageBuilder;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.entities.Emoji;
|
||||
import net.dv8tion.jda.api.entities.MessageChannel;
|
||||
import net.dv8tion.jda.api.entities.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.User;
|
||||
import net.dv8tion.jda.api.events.interaction.GenericComponentInteractionCreateEvent;
|
||||
@ -83,8 +84,8 @@ public class DiscordTicketHandler extends ListenerAdapter {
|
||||
|
||||
@Override
|
||||
public void onGenericComponentInteractionCreate(@NotNull GenericComponentInteractionCreateEvent event) {
|
||||
TextChannel channel = event.getTextChannel();
|
||||
if(channel.getParent() != null && channel.getParent().getId().equals(TICKET_CATEGORY) && event.getComponentId().startsWith("close-")) {
|
||||
MessageChannel messageChannel = event.getChannel();
|
||||
if(messageChannel instanceof TextChannel channel && channel.getParent() != null && channel.getParent().getId().equals(TICKET_CATEGORY) && event.getComponentId().startsWith("close-")) {
|
||||
LinkedList<StringBuilder> messages = channel.getIterableHistory().complete().stream()
|
||||
.filter(message -> !message.getAuthor().isSystem() && !message.getAuthor().isBot())
|
||||
.map(message -> {
|
||||
|
In neuem Issue referenzieren
Einen Benutzer sperren