-
Notifications
You must be signed in to change notification settings - Fork 282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added Incident Webhook Functionality #378
Conversation
server/main.lua
Outdated
@@ -1888,6 +1937,25 @@ function sendToDiscord(color, name, message, footer) | |||
end | |||
end | |||
|
|||
function sendIncidentToDiscord(color, name, message, footer) | |||
if ClockinWebhook == '' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
IncidentWebhook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My mistake will fix this right now
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait - this is just the clock in webhook for the time clock - this should be correct.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait - this is just the clock in webhook for the time clock - this should be correct.
No, you're using the function sendIncidentToDiscord and sending it to ClockinWebhook, it needs to be sent to IncidentWebhook
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MonkeyWhisper - I have corrected this issue. My fault, for whatever reason I was having a brain fart.
server/main.lua
Outdated
@@ -1888,6 +1937,25 @@ function sendToDiscord(color, name, message, footer) | |||
end | |||
end | |||
|
|||
function sendIncidentToDiscord(color, name, message, footer) | |||
if ClockinWebhook == '' then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait - this is just the clock in webhook for the time clock - this should be correct.
No, you're using the function sendIncidentToDiscord and sending it to ClockinWebhook, it needs to be sent to IncidentWebhook
With this PR I have added the ability to have your Incident reports sent to a Discord Webhook.
This works with creating a new Incident as well as with Editing and Saving an incident.
Steps to complete:
This has been tested on my Dev Server, as well as on my live multiplayer server without issue.
Preview of Webhook working: https://i.imgur.com/FpwyAvH.png