Skip to content
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

Merged
merged 3 commits into from
Oct 12, 2023
Merged

Added Incident Webhook Functionality #378

merged 3 commits into from
Oct 12, 2023

Conversation

xSisyphusx
Copy link
Contributor

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:

  • Add webhook at line 24
  • Restart Resource

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

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IncidentWebhook

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

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

Copy link
Contributor Author

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.

Copy link
Member

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

Copy link
Contributor Author

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
Copy link
Member

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

@MonkeyWhisper MonkeyWhisper merged commit 84a6eb1 into Project-Sloth:main Oct 12, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants