Skip to content

Commit

Permalink
Update v1.4.4
Browse files Browse the repository at this point in the history
* Fixed MSK.AddWebhook
  • Loading branch information
Musiker15 committed Feb 12, 2023
1 parent f33ef5a commit f22a74c
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.4.3
1.4.4
2 changes: 1 addition & 1 deletion fxmanifest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ games { 'gta5' }
author 'Musiker15 - MSK Scripts'
name 'msk_core'
description 'Core functions for MSK Scripts'
version '1.4.3'
version '1.4.4'

lua54 'yes'

Expand Down
25 changes: 18 additions & 7 deletions server.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,8 @@ MSK.Notification = function(src, text)
end

MSK.AddWebhook = function(webhook, botColor, botName, botAvatar, title, description, fields, footer, time)
local content = {}

if footer then
if time then
footer = {
Expand All @@ -145,13 +147,22 @@ MSK.AddWebhook = function(webhook, botColor, botName, botAvatar, title, descript
end
end

local content = {{
["title"] = title,
["description"] = description,
["color"] = botColor,
["fields"] = fields,
["footer"] = footer
}}
if fields then
content = {{
["title"] = title,
["description"] = description,
["color"] = botColor,
["fields"] = fields,
["footer"] = footer
}}
else
content = {{
["title"] = title,
["description"] = description,
["color"] = botColor,
["footer"] = footer
}}
end

PerformHttpRequest(webhook, function(err, text, headers) end, 'POST', json.encode({
username = botName,
Expand Down

0 comments on commit f22a74c

Please sign in to comment.