mirror of
https://github.com/PHIDIAS0303/ExpCluster.git
synced 2025-12-31 04:51:40 +09:00
Fixed Discord Alerts
This commit is contained in:
@@ -32,7 +32,7 @@ local function emit_event(args)
|
|||||||
end
|
end
|
||||||
|
|
||||||
local tick = args.tick or game.tick
|
local tick = args.tick or game.tick
|
||||||
local tick_formatted = format_time(tick, {hours = true, minutes = true, string = true, long = true})
|
local tick_formatted = format_time(tick, {days = true, hours = true, minutes = true, string = true, long = true})
|
||||||
|
|
||||||
local players_online = 0
|
local players_online = 0
|
||||||
local admins_online = 0
|
local admins_online = 0
|
||||||
@@ -46,7 +46,7 @@ local function emit_event(args)
|
|||||||
local done = {title=true, color=true, description=true}
|
local done = {title=true, color=true, description=true}
|
||||||
local fields = {{
|
local fields = {{
|
||||||
name='Server Details',
|
name='Server Details',
|
||||||
value=string.format('Server name: ${serverName} Players: %d Admins: %d Time: %s', players_online, admins_online, tick_formatted)
|
value=string.format('Server: ${serverName} Time: %s\nTotal: %d Online: %d Admins: %d', tick_formatted, #game.players, players_online, admins_online)
|
||||||
}}
|
}}
|
||||||
|
|
||||||
for key, value in pairs(args) do
|
for key, value in pairs(args) do
|
||||||
@@ -85,9 +85,9 @@ if config.player_reports then
|
|||||||
title='Report',
|
title='Report',
|
||||||
description='A player was reported',
|
description='A player was reported',
|
||||||
color=Colors.yellow,
|
color=Colors.yellow,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player_name,
|
['By']='<inline>'..by_player_name,
|
||||||
['Reason:']=event.reason
|
['Reason']=event.reason
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
Event.add(Reports.events.on_report_removed, function(event)
|
Event.add(Reports.events.on_report_removed, function(event)
|
||||||
@@ -97,9 +97,9 @@ if config.player_reports then
|
|||||||
title='Reports Removed',
|
title='Reports Removed',
|
||||||
description='A player has a report removed',
|
description='A player has a report removed',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..event.removed_by_name,
|
['By']='<inline>'..event.removed_by_name,
|
||||||
['Amount:']='<inline>'..event.batch_count
|
['Amount']='<inline>'..event.batch_count
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -113,9 +113,9 @@ if config.player_warnings then
|
|||||||
title='Warning',
|
title='Warning',
|
||||||
description='A player has been given a warning',
|
description='A player has been given a warning',
|
||||||
color=Colors.yellow,
|
color=Colors.yellow,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player_name,
|
['By']='<inline>'..by_player_name,
|
||||||
['Reason:']=event.reason
|
['Reason']=event.reason
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
Event.add(Warnings.events.on_warning_removed, function(event)
|
Event.add(Warnings.events.on_warning_removed, function(event)
|
||||||
@@ -125,9 +125,9 @@ if config.player_warnings then
|
|||||||
title='Warnings Removed',
|
title='Warnings Removed',
|
||||||
description='A player has a warning removed',
|
description='A player has a warning removed',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..event.removed_by_name,
|
['By']='<inline>'..event.removed_by_name,
|
||||||
['Amount:']='<inline>'..event.batch_count
|
['Amount']='<inline>'..event.batch_count
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -141,9 +141,9 @@ if config.player_jail then
|
|||||||
title='Jail',
|
title='Jail',
|
||||||
description='A player has been jailed',
|
description='A player has been jailed',
|
||||||
color=Colors.yellow,
|
color=Colors.yellow,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player_name,
|
['By']='<inline>'..by_player_name,
|
||||||
['Reason:']=event.reason
|
['Reason']=event.reason
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
Event.add(Jail.events.on_player_unjailed, function(event)
|
Event.add(Jail.events.on_player_unjailed, function(event)
|
||||||
@@ -152,8 +152,8 @@ if config.player_jail then
|
|||||||
title='Unjail',
|
title='Unjail',
|
||||||
description='A player has been unjailed',
|
description='A player has been unjailed',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player_name
|
['By']='<inline>'..by_player_name
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -167,9 +167,9 @@ if config.player_temp_ban then
|
|||||||
title='Temp Ban',
|
title='Temp Ban',
|
||||||
description='A player has been temp banned',
|
description='A player has been temp banned',
|
||||||
color=Colors.red,
|
color=Colors.red,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player_name,
|
['By']='<inline>'..by_player_name,
|
||||||
['Reason:']=event.reason
|
['Reason']=event.reason
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
Event.add(Jail.events.on_player_untemp_banned, function(event)
|
Event.add(Jail.events.on_player_untemp_banned, function(event)
|
||||||
@@ -178,8 +178,8 @@ if config.player_temp_ban then
|
|||||||
title='Temp Ban Removed',
|
title='Temp Ban Removed',
|
||||||
description='A player has been untemp banned',
|
description='A player has been untemp banned',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player_name
|
['By']='<inline>'..by_player_name
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -193,9 +193,9 @@ if config.player_bans then
|
|||||||
title='Banned',
|
title='Banned',
|
||||||
description='A player has been banned',
|
description='A player has been banned',
|
||||||
color=Colors.red,
|
color=Colors.red,
|
||||||
['Player:']='<inline>'..event.player_name,
|
['Player']='<inline>'..event.player_name,
|
||||||
['By:']='<inline>'..by_player.name,
|
['By']='<inline>'..by_player.name,
|
||||||
['Reason:']=event.reason
|
['Reason']=event.reason
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -206,8 +206,8 @@ if config.player_bans then
|
|||||||
title='Un-Banned',
|
title='Un-Banned',
|
||||||
description='A player has been un-banned',
|
description='A player has been un-banned',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..event.player_name,
|
['Player']='<inline>'..event.player_name,
|
||||||
['By:']='<inline>'..by_player.name
|
['By']='<inline>'..by_player.name
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -221,7 +221,7 @@ if config.player_mutes then
|
|||||||
title='Muted',
|
title='Muted',
|
||||||
description='A player has been muted',
|
description='A player has been muted',
|
||||||
color=Colors.yellow,
|
color=Colors.yellow,
|
||||||
['Player:']='<inline>'..player_name
|
['Player']='<inline>'..player_name
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
Event.add(defines.events.on_player_unmuted, function(event)
|
Event.add(defines.events.on_player_unmuted, function(event)
|
||||||
@@ -230,7 +230,7 @@ if config.player_mutes then
|
|||||||
title='Un-Muted',
|
title='Un-Muted',
|
||||||
description='A player has been un-muted',
|
description='A player has been un-muted',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..player_name
|
['Player']='<inline>'..player_name
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -245,9 +245,9 @@ if config.player_kicks then
|
|||||||
title='Kick',
|
title='Kick',
|
||||||
description='A player has been kicked',
|
description='A player has been kicked',
|
||||||
color=Colors.orange,
|
color=Colors.orange,
|
||||||
['Player:']='<inline>'..player_name,
|
['Player']='<inline>'..player_name,
|
||||||
['By:']='<inline>'..by_player.name,
|
['By']='<inline>'..by_player.name,
|
||||||
['Reason:']=event.reason
|
['Reason']=event.reason
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
@@ -261,7 +261,7 @@ if config.player_promotes then
|
|||||||
title='Promote',
|
title='Promote',
|
||||||
description='A player has been promoted',
|
description='A player has been promoted',
|
||||||
color=Colors.green,
|
color=Colors.green,
|
||||||
['Player:']='<inline>'..player_name
|
['Player']='<inline>'..player_name
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
Event.add(defines.events.on_player_demoted, function(event)
|
Event.add(defines.events.on_player_demoted, function(event)
|
||||||
@@ -270,7 +270,7 @@ if config.player_promotes then
|
|||||||
title='Demote',
|
title='Demote',
|
||||||
description='A player has been demoted',
|
description='A player has been demoted',
|
||||||
color=Colors.yellow,
|
color=Colors.yellow,
|
||||||
['Player:']='<inline>'..player_name
|
['Player']='<inline>'..player_name
|
||||||
}
|
}
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
@@ -284,8 +284,8 @@ Event.add(defines.events.on_console_command, function(event)
|
|||||||
title=event.command:gsub('^%l', string.upper),
|
title=event.command:gsub('^%l', string.upper),
|
||||||
description='/'..event.command..' was used',
|
description='/'..event.command..' was used',
|
||||||
color=Colors.grey,
|
color=Colors.grey,
|
||||||
['By:']='<inline>'..player_name,
|
['By']='<inline>'..player_name,
|
||||||
['Details:'] = event.parameters ~= '' and event.parameters or nil
|
['Details'] = event.parameters ~= '' and event.parameters or nil
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user