Seend a death message to the webhook
This commit is contained in:
		| @ -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(); | ||||||
|  | 			} | ||||||
|  | 		} | ||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  | |||||||
		Reference in New Issue
	
	Block a user