Hadder/src/main/java/com/bbn/hadder/utils/MessageEditor.java
2019-12-02 21:13:20 +01:00

43 lines
1.3 KiB
Java

package com.bbn.hadder.utils;
import net.dv8tion.jda.api.EmbedBuilder;
import java.awt.*;
import java.time.Instant;
public class MessageEditor {
public EmbedBuilder setDefaultSettings(MessageType type) {
EmbedBuilder builder = new EmbedBuilder();
switch (type) {
case INFO:
builder.setColor(new Color(47, 94, 105)).setTimestamp(Instant.now());
break;
case ERROR:
builder.setColor(Color.RED).setTimestamp(Instant.now());
break;
case WARNING:
builder.setColor(Color.ORANGE).setTimestamp(Instant.now());
break;
case NO_PERMISSION:
builder.setTitle("⛔ No Permission ⛔").setDescription("You are not authorized to execute this command!").setColor(Color.RED).setTimestamp(Instant.now());
break;
case NO_SELF_PERMISSION:
builder.setTitle("⛔ No Permission ⛔").setDescription("Unfortunately, I do not have the required rights to perform this action").setColor(Color.RED).setTimestamp(Instant.now());
break;
}
return builder;
}
public enum MessageType {
ERROR,
WARNING,
INFO,
NO_PERMISSION,
NO_SELF_PERMISSION
}
}