This repository was archived by the owner on Nov 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathserver_discordlog.lua
More file actions
44 lines (37 loc) · 1.7 KB
/
server_discordlog.lua
File metadata and controls
44 lines (37 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
-- Insert you Discord Webhook here
local webhookLink = "https://discord.com/api/webhooks/1010886682859548754/h-uunJy8MWCnvlOsjCdgv8XaidlgV-qXjCKn6wVQhXTWk2zauHCBZ_C0mNckoIj3NHqa"
banLog = function(source, bannedby, targetId, time, reason, playerIds, banId)
if not Config.DiscordLog then return end
local botColor = Config.botColor
local botName = Config.botName
local botAvatar = Config.botAvatar
local title = "MSK Bansystem"
local description = ('Player %s (ID: %s) banned the Player %s (ID: %s) for %s until %s'):format(bannedby, source or 0, GetPlayerName(targetId), targetId, reason, time)
local fields = {
{name = "Some IDs", value = playerIds},
}
local footer = {
text = "© MSK Scripts",
link = "https://i.imgur.com/PizJGsh.png"
}
local time = "%d/%m/%Y %H:%M:%S" -- format: "day/month/year hour:minute:second"
addDiscordLog(botColor, botName, botAvatar, title, description, fields, footer, time)
end
unbanLog = function(source, unbannedby, banId)
if not Config.DiscordLog then return end
local botColor = Config.botColor
local botName = Config.botName
local botAvatar = Config.botAvatar
local title = "MSK Bansystem"
local description = ('Player %s (ID: %s) unbanned BanID %s'):format(unbannedby, source or 0, banId)
local fields = false
local footer = {
text = "© MSK Scripts",
link = "https://i.imgur.com/PizJGsh.png"
}
local time = "%d/%m/%Y %H:%M:%S" -- format: "day/month/year hour:minute:second"
addDiscordLog(botColor, botName, botAvatar, title, description, fields, footer, time)
end
addDiscordLog = function(botColor, botName, botAvatar, title, description, fields, footer, time)
MSK.AddWebhook(webhookLink, botColor, botName, botAvatar, title, description, fields, footer, time)
end