Added discord alert

This commit is contained in:
Cooldude2606
2021-04-24 01:47:43 +01:00
parent 43cb24f396
commit cdded68ffb
2 changed files with 16 additions and 0 deletions

View File

@@ -2,6 +2,7 @@
-- @config Discord-Alerts
return {
entity_protection=true,
player_reports=true,
player_warnings=true,
player_bans=true,

View File

@@ -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']='<inline>'..player_name,
['Entity']='<inline>'..event.entity.name
}
end)
end
--- Reports added and removed
if config.player_reports then
local Reports = require 'modules.control.reports' --- @dep modules.control.reports