Seend a death message to the webhook

This commit is contained in:
Debucquoy Anthony 2024-02-04 21:28:26 +01:00
parent 30be45065f
commit d92a8c6125
Signed by: tonitch
GPG Key ID: A78D6421F083D42E

View File

@ -24,5 +24,19 @@ public class BanHourly implements Listener{
e.setKeepLevel(false); e.setKeepLevel(false);
e.getDrops().clear(); e.getDrops().clear();
e.getPlayer().kick(Component.text("Vous etes mort dans la dernière heure... Patientez la prochaine!"), Cause.BANNED); e.getPlayer().kick(Component.text("Vous etes mort dans la dernière heure... Patientez la prochaine!"), Cause.BANNED);
// Send death
String link = DatabaseManager.getInstance().getConfig("discord-wh");
if(!link.equals("")){
DiscordWebhook discord = new DiscordWebhook(link);
discord.setUsername("Ange de la mort");
discord.setAvatarUrl("http://static.planetminecraft.com/files/banners/minecraft_banner_18d1g881yg5831c.png");
discord.setContent(e.getDeathMessage());
try {
discord.execute();
} catch(Exception ex){
ex.printStackTrace();
}
}
} }
} }