add thread archive event
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 58s
All checks were successful
Deploy to Dokku / docker (ubuntu-latest) (push) Successful in 58s
This commit is contained in:
@ -43,6 +43,7 @@ public enum LogType {
|
||||
VOICE_CHANNEL_JOIN(LogCategory.CHANNEL),
|
||||
VOICE_CHANNEL_LEAVE(LogCategory.CHANNEL),
|
||||
CHANNEL_CONFIGURATION(LogCategory.CHANNEL),
|
||||
THREAD_ARCHIVE(LogCategory.CHANNEL),
|
||||
|
||||
/**
|
||||
* Guild Events
|
||||
|
@ -14,6 +14,7 @@ import lombok.extern.log4j.Log4j2;
|
||||
import net.dv8tion.jda.api.Permission;
|
||||
import net.dv8tion.jda.api.Region;
|
||||
import net.dv8tion.jda.api.entities.Member;
|
||||
import net.dv8tion.jda.api.entities.channel.Channel;
|
||||
import net.dv8tion.jda.api.entities.channel.ChannelType;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||
import net.dv8tion.jda.api.entities.channel.concrete.VoiceChannel;
|
||||
@ -289,4 +290,14 @@ public class ChannelListener implements EventListener {
|
||||
.build())
|
||||
.build());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onChannelUpdateArchived(@NonNull BatGuild guild, @NonNull Channel channel, boolean isArchived, @NonNull ChannelUpdateArchivedEvent event) {
|
||||
log.info("Thread \"{}\" was {} in guild \"{}\"", channel.getName(), isArchived ? "archived" : "unarchived", guild.getName());
|
||||
logFeature.sendLog(guild, LogType.THREAD_ARCHIVE, EmbedUtils.successEmbed()
|
||||
.setDescription(new EmbedDescriptionBuilder("Thread %s".formatted(isArchived ? "Archived" : "Unarchived"))
|
||||
.appendLine("Channel: %s".formatted(channel.getAsMention()), true)
|
||||
.build())
|
||||
.build());
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user