Skip to content

Commit f22a74c

Browse files
committed
Update v1.4.4
* Fixed MSK.AddWebhook
1 parent f33ef5a commit f22a74c

File tree

3 files changed

+20
-9
lines changed

3 files changed

+20
-9
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.4.3
1+
1.4.4

fxmanifest.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ games { 'gta5' }
44
author 'Musiker15 - MSK Scripts'
55
name 'msk_core'
66
description 'Core functions for MSK Scripts'
7-
version '1.4.3'
7+
version '1.4.4'
88

99
lua54 'yes'
1010

server.lua

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,8 @@ MSK.Notification = function(src, text)
131131
end
132132

133133
MSK.AddWebhook = function(webhook, botColor, botName, botAvatar, title, description, fields, footer, time)
134+
local content = {}
135+
134136
if footer then
135137
if time then
136138
footer = {
@@ -145,13 +147,22 @@ MSK.AddWebhook = function(webhook, botColor, botName, botAvatar, title, descript
145147
end
146148
end
147149

148-
local content = {{
149-
["title"] = title,
150-
["description"] = description,
151-
["color"] = botColor,
152-
["fields"] = fields,
153-
["footer"] = footer
154-
}}
150+
if fields then
151+
content = {{
152+
["title"] = title,
153+
["description"] = description,
154+
["color"] = botColor,
155+
["fields"] = fields,
156+
["footer"] = footer
157+
}}
158+
else
159+
content = {{
160+
["title"] = title,
161+
["description"] = description,
162+
["color"] = botColor,
163+
["footer"] = footer
164+
}}
165+
end
155166

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

0 commit comments

Comments
 (0)