expire pastes after a month

This commit is contained in:
Lee 2024-11-29 03:38:28 +00:00
parent 892b85ccb4
commit 6db2a01bb3
2 changed files with 3 additions and 2 deletions

View File

@ -18,7 +18,7 @@ import java.net.http.HttpResponse;
@Log4j2(topic = "PasteUtils")
public class PasteUtils {
private static final String PASTE_URL = "https://paste.fascinated.cc/";
private static final String PASTE_UPLOAD_URL = PASTE_URL + "api/upload";
private static final String PASTE_UPLOAD_URL = PASTE_URL + "api/upload?expires=" + 60 * 60 * 24 * 30; // 30 days
private static final HttpClient httpClient = HttpClient.newHttpClient();
/**

View File

@ -11,6 +11,7 @@ import cc.fascinated.bat.service.CommandService;
import lombok.NonNull;
import net.dv8tion.jda.api.entities.MessageEmbed;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import org.jetbrains.annotations.NotNull;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
@ -40,7 +41,7 @@ public class LogFeature extends Feature {
* @param type the type of log
* @param embed the embed to send
*/
public void sendLog(BatGuild guild, LogType type, MessageEmbed embed) {
public void sendLog(@NotNull BatGuild guild, LogType type, MessageEmbed embed) {
FeatureProfile featureProfile = guild.getFeatureProfile();
if (featureProfile.isFeatureDisabled(this)) { // The feature is disabled
return;