Skip to content

Commit

Permalink
files are now in the same message as the embed
Browse files Browse the repository at this point in the history
  • Loading branch information
MaiTheLord committed Dec 4, 2021
1 parent 5e451f8 commit 4253473
Showing 1 changed file with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.TextChannel;
import net.dv8tion.jda.api.events.interaction.GenericInteractionCreateEvent;
import net.dv8tion.jda.api.requests.restaction.MessageAction;
import org.jetbrains.annotations.NotNull;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
Expand Down Expand Up @@ -44,10 +45,11 @@ public static synchronized void log(@NotNull Guild guild, @NotNull EmbedBuilder
return;
}

auditLogChannel.get().sendMessageEmbeds(embed.build()).queue();
MessageAction message = auditLogChannel.get().sendMessageEmbeds(embed.build());
for (VirtualFile file : files) {
auditLogChannel.get().sendFile(file.getAsInputStream(), file.getName()).queue();
message = message.addFile(file.getAsInputStream(), file.getName());
}
message.queue();
}

/**
Expand Down

0 comments on commit 4253473

Please sign in to comment.