forked from Fascinated/Bat
expire pastes after a month
This commit is contained in:
parent
892b85ccb4
commit
6db2a01bb3
@ -18,7 +18,7 @@ import java.net.http.HttpResponse;
|
|||||||
@Log4j2(topic = "PasteUtils")
|
@Log4j2(topic = "PasteUtils")
|
||||||
public class PasteUtils {
|
public class PasteUtils {
|
||||||
private static final String PASTE_URL = "https://paste.fascinated.cc/";
|
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();
|
private static final HttpClient httpClient = HttpClient.newHttpClient();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -11,6 +11,7 @@ import cc.fascinated.bat.service.CommandService;
|
|||||||
import lombok.NonNull;
|
import lombok.NonNull;
|
||||||
import net.dv8tion.jda.api.entities.MessageEmbed;
|
import net.dv8tion.jda.api.entities.MessageEmbed;
|
||||||
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
|
||||||
|
import org.jetbrains.annotations.NotNull;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.context.ApplicationContext;
|
import org.springframework.context.ApplicationContext;
|
||||||
import org.springframework.stereotype.Component;
|
import org.springframework.stereotype.Component;
|
||||||
@ -40,7 +41,7 @@ public class LogFeature extends Feature {
|
|||||||
* @param type the type of log
|
* @param type the type of log
|
||||||
* @param embed the embed to send
|
* @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();
|
FeatureProfile featureProfile = guild.getFeatureProfile();
|
||||||
if (featureProfile.isFeatureDisabled(this)) { // The feature is disabled
|
if (featureProfile.isFeatureDisabled(this)) { // The feature is disabled
|
||||||
return;
|
return;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user