Almost Done with LiteBansEvents
This commit is contained in:
@@ -19,22 +19,42 @@ public class LiteBansEvents extends Events.Listener {
|
||||
@Override
|
||||
public void entryAdded(Entry entry) {
|
||||
if (entry.getType().equals("ban")) {
|
||||
if (entry.getExecutorUUID() == null) return;
|
||||
if (entry.getUuid() == null) return;
|
||||
UUID target = UUID.fromString(entry.getUuid());
|
||||
UUID executor = UUID.fromString(entry.getExecutorUUID());
|
||||
sendBanLog(target,executor,entry.getReason(),entry.getDurationString());
|
||||
}
|
||||
if (entry.getType().equals("mute")) {
|
||||
if (entry.getExecutorUUID() == null) return;
|
||||
if (entry.getUuid() == null) return;
|
||||
UUID target = UUID.fromString(entry.getUuid());
|
||||
UUID executor = UUID.fromString(entry.getExecutorUUID());
|
||||
sendMuteLog(target,executor,entry.getReason(),entry.getDurationString());
|
||||
}
|
||||
}
|
||||
@Override
|
||||
public void entryRemoved(Entry entry) {
|
||||
if (entry.getType().equals("ban")) {
|
||||
/* This will be done soon */
|
||||
if (entry.getExecutorUUID() == null) return;
|
||||
if (entry.getUuid() == null) return;
|
||||
UUID target = UUID.fromString(entry.getUuid());
|
||||
UUID executor = UUID.fromString(entry.getExecutorUUID());
|
||||
sendUnbanLog(target,executor,entry.getReason());
|
||||
}
|
||||
if (entry.getType().equals("mute")) {
|
||||
if (entry.getExecutorUUID() == null) return;
|
||||
if (entry.getUuid() == null) return;
|
||||
UUID target = UUID.fromString(entry.getUuid());
|
||||
UUID executor = UUID.fromString(entry.getExecutorUUID());
|
||||
sendUnmuteLog(target,executor,entry.getReason());
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
public static void sendBanLog(UUID target, UUID executerUUID, String reason, String time) {
|
||||
String name = Bukkit.getPlayer(target).getName();
|
||||
String executor = Bukkit.getPlayer(executerUUID).getName();
|
||||
public static void sendBanLog(UUID target, UUID executerUUID, String reason, String duration) {
|
||||
String name = Bukkit.getOfflinePlayer(target).getName();
|
||||
String executor = Bukkit.getOfflinePlayer(executerUUID).getName();
|
||||
Webhook webhook = new Webhook("https://discord.com/api/webhooks/1110731451982422136/U33AFoT3nVpVo2iTO2kVRuHV4F4PdOtJDp8xsTavkmctU0fDKmW0ckxfGtpKKjobH-Cb");
|
||||
webhook.setAvatarUrl("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/3lwit5nt.png");
|
||||
webhook.setUsername("Staff Logs");
|
||||
@@ -47,6 +67,7 @@ public class LiteBansEvents extends Events.Listener {
|
||||
)
|
||||
.addField("Banned By: ", "`" + executor + "` " + Emojis.trustedAdmin, false)
|
||||
.addField("Reason: ", reason + " " + Emojis.activity, false)
|
||||
.addField("Duration: ", duration, false)
|
||||
.setColor(Color.red)
|
||||
.setThumbnail("https://crafatar.com/avatars/" + target + "?size=64&&overlay");
|
||||
webhook.addEmbed(embed);
|
||||
@@ -57,4 +78,77 @@ public class LiteBansEvents extends Events.Listener {
|
||||
}
|
||||
}
|
||||
|
||||
public static void sendMuteLog(UUID target, UUID executerUUID, String reason, String duration) {
|
||||
String name = Bukkit.getOfflinePlayer(target).getName();
|
||||
String executor = Bukkit.getOfflinePlayer(executerUUID).getName();
|
||||
Webhook webhook = new Webhook("https://discord.com/api/webhooks/1110731451982422136/U33AFoT3nVpVo2iTO2kVRuHV4F4PdOtJDp8xsTavkmctU0fDKmW0ckxfGtpKKjobH-Cb");
|
||||
webhook.setAvatarUrl("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/3lwit5nt.png");
|
||||
webhook.setUsername("Staff Logs");
|
||||
Webhook.EmbedObject embed = new Webhook.EmbedObject()
|
||||
.setAuthor("Staff Punishment","","")
|
||||
.setTitle("Staff have Muted a member")
|
||||
.setDescription(
|
||||
Emojis.rightSort + "Username: `" + name + "` " + Emojis.target + "\\n" +
|
||||
Emojis.space + Emojis.arrowRight + "UUID: `" + target + "`\\n"
|
||||
)
|
||||
.addField("Muted By: ", "`" + executor + "` " + Emojis.trustedAdmin, false)
|
||||
.addField("Reason: ", reason + " " + Emojis.activity, false)
|
||||
.addField("Duration: ", duration, false)
|
||||
.setColor(Color.yellow)
|
||||
.setThumbnail("https://crafatar.com/avatars/" + target + "?size=64&&overlay");
|
||||
webhook.addEmbed(embed);
|
||||
try {
|
||||
webhook.execute();
|
||||
} catch (IOException e) {
|
||||
OgreDupeAlias.log.info(e.toString());
|
||||
}
|
||||
}
|
||||
public static void sendUnbanLog(UUID target, UUID executerUUID, String reason) {
|
||||
String name = Bukkit.getOfflinePlayer(target).getName();
|
||||
String executor = Bukkit.getOfflinePlayer(executerUUID).getName();
|
||||
Webhook webhook = new Webhook("https://discord.com/api/webhooks/1110731451982422136/U33AFoT3nVpVo2iTO2kVRuHV4F4PdOtJDp8xsTavkmctU0fDKmW0ckxfGtpKKjobH-Cb");
|
||||
webhook.setAvatarUrl("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/3lwit5nt.png");
|
||||
webhook.setUsername("Staff Logs");
|
||||
Webhook.EmbedObject embed = new Webhook.EmbedObject()
|
||||
.setAuthor("Staff Pardon","","")
|
||||
.setTitle("Staff have Unbanned a member")
|
||||
.setDescription(
|
||||
Emojis.rightSort + "Username: `" + name + "` " + Emojis.target + "\\n" +
|
||||
Emojis.space + Emojis.arrowRight + "UUID: `" + target + "`\\n"
|
||||
)
|
||||
.addField("Unbanned By: ", "`" + executor + "` " + Emojis.trustedAdmin, false)
|
||||
.addField("Reason: ", reason + " " + Emojis.activity, false)
|
||||
.setColor(Color.green)
|
||||
.setThumbnail("https://crafatar.com/avatars/" + target + "?size=64&&overlay");
|
||||
webhook.addEmbed(embed);
|
||||
try {
|
||||
webhook.execute();
|
||||
} catch (IOException e) {
|
||||
OgreDupeAlias.log.info(e.toString());
|
||||
}
|
||||
}
|
||||
public static void sendUnmuteLog(UUID target, UUID executerUUID, String reason) {
|
||||
String name = Bukkit.getOfflinePlayer(target).getName();
|
||||
String executor = Bukkit.getOfflinePlayer(executerUUID).getName();
|
||||
Webhook webhook = new Webhook("https://discord.com/api/webhooks/1110731451982422136/U33AFoT3nVpVo2iTO2kVRuHV4F4PdOtJDp8xsTavkmctU0fDKmW0ckxfGtpKKjobH-Cb");
|
||||
webhook.setAvatarUrl("https://r2.e-z.host/d440b58a-ba90-4839-8df6-8bba298cf817/3lwit5nt.png");
|
||||
webhook.setUsername("Staff Logs");
|
||||
Webhook.EmbedObject embed = new Webhook.EmbedObject()
|
||||
.setAuthor("Staff Pardon","","")
|
||||
.setTitle("Staff have Unmuted a member")
|
||||
.setDescription(
|
||||
Emojis.rightSort + "Username: `" + name + "` " + Emojis.target + "\\n" +
|
||||
Emojis.space + Emojis.arrowRight + "UUID: `" + target + "`\\n"
|
||||
)
|
||||
.addField("Unmuted By: ", "`" + executor + "` " + Emojis.trustedAdmin, false)
|
||||
.addField("Reason: ", reason + " " + Emojis.activity, false)
|
||||
.setColor(Color.green)
|
||||
.setThumbnail("https://crafatar.com/avatars/" + target + "?size=64&&overlay");
|
||||
webhook.addEmbed(embed);
|
||||
try {
|
||||
webhook.execute();
|
||||
} catch (IOException e) {
|
||||
OgreDupeAlias.log.info(e.toString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,11 +3,15 @@ version: '${version}'
|
||||
main: fun.ogre.ogredupealias.OgreDupeAlias
|
||||
api-version: 1.19
|
||||
prefix: ODA
|
||||
depend: [ LiteBans ]
|
||||
authors: [ ImproperIssues, TheTrouper ]
|
||||
description: Server utilities for OgreDupe.minehut.gg
|
||||
website: https://itzispyder.github.io/
|
||||
website: https://itzispyder.github.io/q
|
||||
|
||||
permissions:
|
||||
oda.dupe:
|
||||
description: Access to the dupe command
|
||||
default: op
|
||||
oda.store:
|
||||
description: Access to the store
|
||||
default: op
|
||||
@@ -68,6 +72,10 @@ permissions:
|
||||
description: Show a donation
|
||||
default: op
|
||||
commands:
|
||||
ogredupe:
|
||||
usage: /ogredupe [<int>] [<stack>] [<exponential>]
|
||||
description: Dupelictate the item in your hand
|
||||
permission: oda.dupe
|
||||
changerank:
|
||||
usage: /changerank
|
||||
description: Change your rank prefix or your custom tag
|
||||
|
||||
Reference in New Issue
Block a user