From cdded68ffb760d29d8c671100370b94c1cab7917 Mon Sep 17 00:00:00 2001 From: Cooldude2606 Date: Sat, 24 Apr 2021 01:47:43 +0100 Subject: [PATCH] Added discord alert --- config/discord_alerts.lua | 1 + modules/addons/discord-alerts.lua | 15 +++++++++++++++ 2 files changed, 16 insertions(+) diff --git a/config/discord_alerts.lua b/config/discord_alerts.lua index 1890aa4b..be3bceca 100644 --- a/config/discord_alerts.lua +++ b/config/discord_alerts.lua @@ -2,6 +2,7 @@ -- @config Discord-Alerts return { + entity_protection=true, player_reports=true, player_warnings=true, player_bans=true, diff --git a/modules/addons/discord-alerts.lua b/modules/addons/discord-alerts.lua index fbeabf8a..fe13ec5c 100644 --- a/modules/addons/discord-alerts.lua +++ b/modules/addons/discord-alerts.lua @@ -76,6 +76,21 @@ local function emit_event(args) }) end +--- Repeat protected entity mining +if config.entity_protection then + local EntityProtection = require 'modules.control.protection' --- @dep modules.control.protection + Event.add(EntityProtection.events.on_repeat_violation, function(event) + local player_name = get_player_name(event) + emit_event{ + title='Entity Protection', + description='A player removed protected entities', + color=Colors.yellow, + ['Player']=''..player_name, + ['Entity']=''..event.entity.name + } + end) +end + --- Reports added and removed if config.player_reports then local Reports = require 'modules.control.reports' --- @dep modules.control.reports